Cod sursa(job #1717878)
Utilizator | Data | 15 iunie 2016 23:21:29 | |
---|---|---|---|
Problema | Secventa 5 | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <bits/stdc++.h>
using namespace std;
typedef long long i64;
char str[50];
int main(void) {
ifstream f("kbiti.in");
ofstream g("kbiti.out");
int n;
i64 ans;
f>>n;
while(n--) {
f>>str;
ans = 0LL;
for(int i=0; str[i]; ++i) {
ans<<=1;
ans|=(str[i]=='1')?1:0;
}
g<<++ans<<'\n';
}
f.close();
g.close();
return 0;
}