View Code of Problem 66

#include<stdio.h>
int main(){
int a,b,c;
int i,j;
  while(scanf("%d%d",&a,&b)!=EOF){
    if(a=b)
    {pritnf("1");}
    else{
      for(i=0;i<a;i++){
        if(a%i==0&&b%i==0){
        a=a/i;
        b=b/i;
        }
      } 
      printf("%d/%d",a,b);
    	}
  }
return 0;
}
/*
Main.c: In function 'main':
Main.c:6:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
     if(a=b)
     ^
Main.c:7:5: warning: implicit declaration of function 'pritnf' [-Wimplicit-function-declaration]
     {pritnf("1");}
     ^
Main.c:4:7: warning: unused variable 'j' [-Wunused-variable]
 int i,j;
       ^
Main.c:3:9: warning: unused variable 'c' [-Wunused-variable]
 int a,b,c;
         ^
/tmp/ccIk2EEM.o: In function `main':
Main.c:(.text+0x22): undefined reference to `pritnf'
collect2: error: ld returned 1 exit status
*/

Double click to view unformatted code.


Back to problem 66