Demo entry 6751505

水仙花数

   

Submitted by Moshi on Jun 24, 2018 at 10:14
Language: C. Code size: 208 Bytes.

#include <stdio.h>
#include <stdlib.h>
int main() {
	int i,j,k,n;
	for(n=100; n<999; n++) {
		i=n/100;
		j=n/10%10;
		k=n%10;
		if(n==i*i*i+j*j*j+k*k*k) {
			printf("%-5d",n);
		}
	}
	return 0;
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).