C語言新手 請教問題

今年剛升上高二 多了一門課 C語言
老師出了作業


輸入五個數算出總和 與 其平均數

小弟不知道我哪裡寫錯了每次輸入出來都是 -115099961

請大大幫忙一下 謝謝

int a,b,c,d,e;
cout<< "請輸入五個數字"<< endl;<br>cin>>a,b,c,d,e;
cout<< "五數的總和為"<< endl;<br>cout<< a>system("PAUSE");
return EXIT_SUCCESS;
2012-09-22 10:19 發佈
int a,b,c,d,e;
cout<< "請輸入五個數字"<< endl;
cin>>a>>b>>c>>d>>e;
cout<< "五數的總和為"<< endl;
cout<< a+b+c+d+e << endl;

CIN 變數中間要放>> 不能放,
原來是這樣喔 謝謝你喔

sosxy0601 wrote:
今年剛升上高二 多了...(恕刪)
話說這code是C++吧!?
C的輸入輸出是用scanf和printf
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
printf("%d",a+b+c+d+e);
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?