编写程序数一下 1到 100 的所有整数中出现多少次数字9

来源:互联网 发布:java链表反序 编辑:程序博客网 时间:2024/06/05 06:56
#define _CRT_SECURE_NO_WARNINGS 1#include<stdio.h>int main(){int i = 0;int count = 0;for (i = 0; i <= 100; i++){if (i % 10 == 9){count++;}if (i / 10 == 9){count++;}}printf("%d\n", count);system("pause");return 0;}

阅读全文
0 0