Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main(){
- int n,m,k;
- do{
- scanf("%d",&n);
- }while(!(n>4 || n==4));
- int i,j;
- int broj = 18;
- for(i=n-1;i!=0;i--){
- for(j=n-1;j!=0;j--){
- if(pow(i,j)<=n){
- if((n-pow(i,j)) <= broj){
- broj=n-pow(i,j);
- m=i;
- k=j;
- }
- }
- }}
- printf("%d\t%d\t%d\t%d",n,m,k,broj);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement