[Algorithm] BOJ 11720
#include <iostream>
#include <string>
using namespace std;
int main()
{
int cnt = 0;
string num;
int sum = 0;
int tmp = 0;
cin >> cnt;
cin >> num;
for(int i = 0; i < cnt; i++)
sum += num[i] -'0';
cout << sum;
return 0;
}
댓글남기기