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

20 lines
269 B
C

#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;
}