Advertisement
thedigletdistroyer

Untitled

Feb 5th, 2023
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int n,c1,c2,s;
  5. int main()
  6. {
  7.     cin>>n;
  8.     while(n>100)
  9.         n/=10;
  10.     c2=n%10;
  11.     c1=n/10;
  12.     s=c1+c2;
  13.     cout<<s;
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement