Solução: Problema da simplificação das frações (Bruno Barbosa)
From AdonaiMedrado.Pro.Br
Revision as of 17:13, 5 June 2009 by 200.17.147.2 (Talk)
#include <stdio.h> int main(){ int n, m, i; scanf("%d %d", &n, &m); while(n || m){ if(!n || !m){ printf("%d %d\n", n, m); } else{ if(n==m){ i = m; printf("%d %d\n", n/i, m/i); } if(n>m){ i = m; printf("%d %d\n", n/i, m/i); } if(m>n){ i= n; printf("%d %d\n", n/i, m/i); } } scanf("%d %d", &n, &m); } }