Q
백준 11720

C code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| #include <stdio.h>
int main(void) { int n = 0, sum = 0, ch[101];
scanf("%d", &n);
if(n < 1 && n > 100) return 0; for(int i = 0; i < n; i++) { scanf("%1d", &ch[i]); sum += ch[i]; } printf("%ld\n", sum);
return 0; }
|
Author:
Slay
Permalink:
http://sean-baek.github.io/2023/04/30/baekjoon-11720/
License:
Copyright (c) 2021 CC-BY-NC-4.0 LICENSE
Slogan:
Do you believe in DESTINY?