- public static int euclid_iter(int m, int n)
- {
- int x = m;
- int y = n;
- int d;
- //
- while(x!=y)
- {
- if(y>x)
- {
- d = y-x;
- y = d;
- }
- else if(y<x)
- {
- d = x-y;
- x = d;
- }
- }
- return(x);
- }
datastructures
By: D | Date: Oct 29 2009 19:31 | Format: None | Expires: never | Size: 244 B | Hits: 927
Latest pastes
16 hours ago
16 hours ago
1 days ago
2 days ago
4 days ago