Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<fstream>
- #include <vector>
- #include <iostream>
- using namespace std;
- int main()
- {
- int n = 10;
- int sum =0;
- int m = 0;
- for(int i =0; i<100000; i++)
- {
- if((n/10)!=0)
- {
- m = n%10;
- n = n/10;
- sum = m*m;
- }
- else{
- m = n;
- sum =sum+ m*m;
- break;
- }
- }
- cout << sum;
- }
Advertisement
Add Comment
Please, Sign In to add comment