uva 10879 - Code Refactoring

超级水题。。提交的时候还在疑惑呢。。。

#include <stdio.h> int main() { int n; scanf("%d", &n); for(int i = 1; i <= n; i++) { int k; scanf("%d", &k); printf("Case #%d: %d = ", i, k); int a, b; int count = 0; for(a = 2; ; a++) { int tmp1 = k % a; if(tmp1 != 0) continue; b = k / a; if(a == b) continue; if(count == 0) printf("%d * %d = ", a, b); else { printf("%d * %d/n", a, b); break; } count++; } } return 0; } 

你可能感兴趣的:(uva 10879 - Code Refactoring)