fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. while(t--){
  8. string s;
  9. cin >> s;
  10. int len = s.length();
  11. int m=0;
  12. for(int i=0; i<len; i++){
  13. int t = s[i] - '0';
  14. m = m*10 + t;
  15. }
  16. cout << m << endl;
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5272KB
stdin
7
1
2
178
20
999999999
9000
987654321
stdout
1
2
178
20
999999999
9000
987654321