- 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: 872
Latest pastes
4 days ago
5 days ago
5 days ago
7 days ago
8 days ago