C/C++の宿題を片付け ..
498:デフォルトの名無しさん
07/05/20 16:09:51
>>496
#include "stdio.h"
int main(){
int i,n,ans=0;
printf("1からnまでの和を計算します\nnを入力してください:");
scanf("%d",&n);
i=n;
while(i)ans+=i--;
printf("1から5までの和は%dです。\n",ans);
return 1;
}
次ページ最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4186日前に更新/299 KB
担当:undef