Homework2 Version 0 |
|
👤 Author: by yannickkalisagmailcom 2018-10-22 01:55:50 |
#include<bits/stdc++.h>
using namespace std;
int sumOfDigits(int );
// Returns sum of all digits in numbers from 1 to 10
int sumOfDigitsFrom1To10(int n)
{
int result = 0; // initialize result
// One by one compute sum of digits in every number from
// 1 to n
for (int x = 1; x <= 10; x++)
result += sumOfDigits(x);
return result;
}
Address Cells 2101
A0 21 2202
A1 01 2303
A2 22 2404
A3
全文(Full Article):