fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. int main() {
  5. ll N;
  6. cin>>N;
  7. long long k=0;
  8. for(int i= 1; i<=N;i++){
  9. if(i%9==0)
  10. k+=i;
  11. }
  12. cout<<k;
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5292KB
stdin
20
stdout
27