c语言
来源:互联网 发布:淘宝网返利链接的制作 编辑:程序博客网 时间:2024/06/07 20:22
#include <stdbool.h>
/* C99 only */
#include <stdio.h>
?
int main(void)
{
bool digit_seen[10] = {false};
int digit;
long n;
?
printf("Enter a number: ");
scanf("%ld", &n);
while (n > 0) {
digit = n % 10;
if (digit_seen[digit])
break;
digit_seen[digit] = true;
n /= 10;
}
if (n > 0)
printf("Repeated digit\n");
else
printf("No repeated digit\n");
?
return 0;
}
/* C99 only */
#include <stdio.h>
?
int main(void)
{
bool digit_seen[10] = {false};
int digit;
long n;
?
printf("Enter a number: ");
scanf("%ld", &n);
while (n > 0) {
digit = n % 10;
if (digit_seen[digit])
break;
digit_seen[digit] = true;
n /= 10;
}
if (n > 0)
printf("Repeated digit\n");
else
printf("No repeated digit\n");
?
return 0;
}
0 0
- C语言
- C语言
- C语言
- C语言
- C语言
- c语言
- C语言
- C语言
- C语言
- C语言
- c语言
- C语言
- C语言
- C语言
- c语言
- C语言
- c语言
- c语言
- 【CCF 俄罗斯方块】
- 李理:详解卷积神经网络
- git 带着修改checkout 到其他分支
- 洛谷 1144
- css布局左右定宽,中间自适应
- c语言
- 表单验证等其他公用js方法
- 学年论文_车对车超宽带无线通信技术研究
- struts配置结果以及Action中关于 request 与 session 的注入
- IP地址分类
- jQuery中li的变化
- Hierarchical deformation of Locally Rigid Meshes
- asp rs记录集recordset常用操作代码 详细
- curl 源码分析