统计100以内的各位数字之和为5的自然数的个数。
输出格式:
直接输出结果,没有任何多余字符。
输出样例:
6
public class Main {
public static void main(String[] args) {
int count=0;
for(int n=1;n<100;n++)
{
int a,b;
a=n%10;
b=n/10;
if(a+b==5)
count++;}
System.out.print(count);
}
}