Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main(){
- int n;
- int i;
- int x;
- int cifre;
- int y;
- int z;
- for(n=100; n<=999; n++){
- x=n%10;
- y=(n/10)%10; // pomocu ostatka pri deljenju izdvajamo cifru po cifru
- z=(n/100)%10;
- cifre=pow(x,3)+pow(z,3)+pow(y,3);
- if(n==cifre){
- printf("\n\tArmstrongov broj je %d%d%d\n",z,y,x);
- } else;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement