标签:
#include <iostream> #include <cstdio> using namespace std; int t; int f(int m, int n) { if(m<n) return (f(n,m)); t += m/n; if(m%n==0) return 0; f(n,m%n); } int main() { int m, n, T; scanf("%d", &T); while(T--) { scanf("%d%d", &m, &n); t=0; f(m, n); printf("%d\n", t); } return 0; }
标签:
原文地址:http://www.cnblogs.com/Noevon/p/5425955.html