close
Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決 
Kindle Book Deals

We find the best deals on best-selling Kindle books for you. Just tell us which genres you love and we'll do the rest. The best part? It's completely free!
From our sponsors
c++ 算平均
Nov 6th 2013, 11:08

老師出了一題題目
執行結果要 :

輸入起點 : 6
輸入終點: 10
平均 :8

我還是試不出來 不知道怎麼在迴圈中加總後除各數

請問是要在迴圈中 作加法呢? 還是迴圈外?

以下是我打的程式
#include <stdio.h>
#include <stdlib.h>

main()
{
int i ,start,end,total=0;
printf("請輸入開始:");
scanf("%d",&start);

printf("請輸入結束:");
scanf("%d",&end);

i=start;
while(i<=end)
{
printf("i=%d\n",i);
i++;

}

system("pause");
}

希望有人能幫忙 謝謝

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends:

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 yhiysbv 的頭像
    yhiysbv

    海霸王年菜2016 , 台酒年菜2016 , 外帶年菜2016 , 飯店年菜2016 , 素食年菜2016 , 高雄年菜2016 , 阿霞飯店年菜2016 (年菜菜單)2016年菜預購 高雄年菜餐廳 ... 2016

    yhiysbv 發表在 痞客邦 留言(0) 人氣()