-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathALCATRAZ1.cpp
65 lines (59 loc) · 1.08 KB
/
ALCATRAZ1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
nerdyninja
ALCATRAZ1
adhoc
*/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;
#define INF (int)1e9
#define EPS 1e-9
#define REP(i, a, b) for(int i = a; i < b; ++i)
#define PB push_back
#define MP make_pair
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<ll> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
const float PI = 3.1415926535897932384626433832795;
const int MOD = 1000000007;
int main()
{
//freopen(".in", "r", stdin);
//freopen(".out", "w", stdout);
int tt;
scanf("%d", &tt);
REP(qq, 0, tt){
char x[100];
scanf("%s", x);
int l = strlen(x);
ll ans = 0;
for(int i = 0; i < l; i++){
ans += x[i]-'0';
}
printf("%lld\n", ans);
}
return 0;
}