3 5 7
8 12 15
7 3 5
Problem 2
for (int K = 1; K*K < 500; K++) cout << K*K << endl;
Problem 3
double SphereArea(double R){
return 4*pi*R*R;
}
Problem 4
int NumDigits(string s){
int count = 0;
for (int K = 0; K < s.length(); K++)
if (('0' <= s[K]) and (s[K] <= '9'))
count ++;
return count;
}
Problem 5
2 10
5 101
14 1110
Problem 6
01100100binary = 64 + 32 + 4 = 100decimal
01010101binary = 64 + 16 + 4 + 1= 85decimal
01111000binary = 64 + 32+ 16 + 8 = 120decimal