mirror of
https://gitlab.gwdg.de/j.hahn02/university.git
synced 2026-01-01 06:44:25 -05:00
refactor various files
This commit is contained in:
14
S1/GdCP/uebung/square.c
Normal file
14
S1/GdCP/uebung/square.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int num, sum = 0;
|
||||
scanf("%d", &num);
|
||||
|
||||
while (num > 0) {
|
||||
sum += num % 10;
|
||||
num /= 10;
|
||||
}
|
||||
|
||||
printf("%d\n", sum);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user