我是 ios 编程新手。我对 GCD 计划有疑问。
01 // This program finds the greatest common divisor of two nonnegative integer values
02
03 #import <Foundation/Foundation.h>
04
05 int main (int argc, const char * argv[]) {
06 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
07 unsigned int u, v, temp;
08
09 NSLog(@"Please type in two nonnegative integers.");
10 scanf("%u%u", &u, &v);
11
12 while (v != 0) {
13 temp = u % v;
14 u = v;
15 v = temp;
16 }
17
18 NSLog(@"Their greatest common divisor is %u", u);
19
20 [pool drain];
21 return 0;
22 }
我不明白这部分:
while(v!=0)
temp = u%v
u =v;
v = temp;
这是什么意思,用英语?