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

  • <center id="usuqs"></center>
  • 
    
  • 統(tǒng)計(jì)100-999之間滿足條件“百位數(shù)字加十位數(shù)字加個(gè)位數(shù)字的和能被5整除”的數(shù)的個(gè)數(shù),并輸出統(tǒng)計(jì)結(jié)果.

    統(tǒng)計(jì)100-999之間滿足條件“百位數(shù)字加十位數(shù)字加個(gè)位數(shù)字的和能被5整除”的數(shù)的個(gè)數(shù),并輸出統(tǒng)計(jì)結(jié)果.
    其他人氣:867 ℃時(shí)間:2020-01-29 03:25:04
    優(yōu)質(zhì)解答
    幫你寫了一個(gè),你看一下:
    #include <stdio.h>
    main()
    {
        int i = 0;
        int j = 0;
        int sum = 0;
        int temp = 0;
        int count = 0;
        printf("結(jié)果能被5整除的數(shù)有:\n");
        for (i=100; i<=999; i++)
        {
            temp = i;
            for (j=0; j<3; j++)
            {
                sum += (temp%10);
                temp /= 10;
            }
            if(0 == (sum%5))
            {
                count++;
                printf("%d  ", i);
            }
            sum = 0;
        }
        printf("\n共%d個(gè)\n", count);
        system("pause");
        return 0;
    }




    運(yùn)行結(jié)果:
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版