fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6. long long n;
  7. cin >> n;
  8. if(n % 9 == 0) cout << "9";
  9. else cout << n % 9;
  10. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
5