Question:
http://uva.onlinejudge.org/external/116/11636.html
Solution:
int main(){
...
.....
scanf("%d", &n);
if(n<0) break;
if(n>1){
j = 0;
line = 1;
for(j=1; ; j++){
line *= 2;
if(line >= n) break;
}
....
....}
http://uva.onlinejudge.org/external/116/11636.html
Solution:
int main(){
...
.....
scanf("%d", &n);
if(n<0) break;
if(n>1){
j = 0;
line = 1;
for(j=1; ; j++){
line *= 2;
if(line >= n) break;
}
....
....}
No comments:
Post a Comment