fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. bool tong(int n){
  5. int sum = 0;
  6. while(n > 0){
  7. sum += n % 10;
  8. n /= 10;
  9. }
  10. return (sum % 10 == 9);
  11. }
  12.  
  13. int32_t main(){
  14. ios_base::sync_with_stdio(false);
  15. cin.tie(NULL);
  16.  
  17. int n;
  18. cin >> n;
  19. cout << tong(n);
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5288KB
stdin
111
stdout
Standard output is empty