C
- voluntas
- @ignis_fatuus
- ブン
- @Linda_pp
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- takezoh
- まろ
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- I (@wx257osn2)
- Tommy6
- @tyottyoworks
- ___shanon
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
- むてら
- ガチKGB
- 三重野賢人
x
16
1
2
void main()
3
{
4
int num, count = 0;
5
printf("please enter number:");
6
scanf("%d", &num);
7
while(num!=0)
8
{
9
count += num % 10;
10
num /= 10;
11
12
13
}
14
printf("the new number is %d\n", count);
15
16
}
$ gcc prog.c -Wall -Wextra -std=gnu11
Stdin
334
Start
prog.c:2:6: warning: return type of 'main' is not 'int' [-Wmain] 2 | void main() | ^~~~
please enter number:the new number is 10
21
Finish