1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 14:36:19 +00:00
202401-programming-assignments/【额外练习】选择结构/7-17 选择-水仙花数.c

20 lines
269 B
C
Raw Normal View History

2024-10-30 15:00:18 +00:00
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int a = n / 100;
int b = n / 10 % 10;
int c = n % 10;
if (n == a * a * a + b * b * b + c * c * c) {
printf("yes\n");
} else {
printf("no\n");
}
return 0;
}