A33076. 请你统计所有两位数(10~99)中,个位与十位相加为 8 的两位数的个数。
填空题
较难
知识点
题目描述
请你统计所有两位数(10~99)中,个位与十位相加为 8 的两位数的个数。
参考答案
#include <iostream>
using namespace std;
int main() {
int a=0;
for(int i=10; i<=99; i++) {
if(i/10+i%10==8) {
a++;
}
}
cout<<a<<endl;
return 0;
}
上一题
下一题