精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • 將兩個兩位數(shù)的正整數(shù)a,b合并成一個整數(shù)放在c中,合并的方式

    將兩個兩位數(shù)的正整數(shù)a,b合并成一個整數(shù)放在c中,合并的方式
    請各位幫忙寫你個小程序,將兩個兩位數(shù)的正整數(shù)a,b合并成一個整數(shù)放在c中,合并的方式;
    將a數(shù)的十位和個位放在c的千位和十位上,b數(shù)的十位和個位數(shù)依次放c的個位和百位上如當(dāng)a=45,b=12時(shí)c=4251
    主函數(shù)已經(jīng)給了,幫我編一下子函數(shù),
    #include
    #include
    #include
    void fun(int a,int b,long *c)
    {
    }
    main()
    { int a,b;long c;
    system("cls");
    printf("Input a,b:");
    scanf("%d%d",&a,&b);
    fun(a,b,&c);
    printf("The result is:%ld\n",c);
    其他人氣:134 ℃時(shí)間:2020-06-19 13:21:08
    優(yōu)質(zhì)解答
    #include
    #include
    #include
    void fun(int a,int b,long *c)
    {
    int a1,a2,b1,b2; /*分別存放a數(shù)十位,a數(shù)個位,b數(shù)十位,b數(shù)個位的數(shù)字*/
    a1 = a/10;
    a2 = a%10;
    b1 = b/10;
    b2 = b%10;
    *c = a1 * 1000 + b2 * 100 + a2 * 10 + b1; /*數(shù)字按要求組合,存入c*/
    }
    main()
    {
    int a,b;
    long c=0;
    system("cls");
    printf("Input a,b:");
    scanf("%d%d",&a,&b);
    fun(a,b,&c);
    printf("The result is:%ld\n",c);
    return 0;
    }
    vc++ 6.0 成功運(yùn)行
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版