(1) i=1; k=0; while ( i<=n-1) { @ k += 10 * i; i++; } (2) i=1; k=0; do { @ k +=10 * i; i++; } while(i<=n-1); (3) i = 1; k = 0; while (i<=n-1) { i++ ; @ k+= 10 * i; } (4) k=0; for( i=1; i<=n; i++) { for (j=i ; j<=n; j++) @ k++; } (5) for( i=1; i<=n; i++) { for (j=1; j<=i; j++) { for (k=1; k<=j; k++) @ x += delta; } } (6) i=1; j=0; while (i+j<=n) { @ if (i>j ) j++ ; else i++ ; } (7) x=n; y=0; // n 是不小于1的常数 while (x>=(y+1)*(y+1)) { @ y++; } (8) x=91; y=100; while (y>0 ) { @ if (x>100 ) { x -= 10; y- -; } else x++; }
JanTCode wrote:I want to know the executing times of the sentence labled by '@' when n is gived
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)