カウントについて
Posted: 2010年6月03日(木) 15:37
龍神録のプログラムでは、ステージカウントを表示するとカウントが一秒で60増えますよね。
でも↓の
#include <stdio.h>
int main(){
int cnt;
cnt=0;
while(1){
printf("%d\r",cnt);
cnt++;
}
fflush(stdin);
getchar();
return(0);
}
というコードではあっという間にものすごい数が増えてしまいます。
一応
#include <stdio.h>
int main(){
int cnt,s;
cnt=0;
while(1){
s=cnt/100;
printf("%d\r",s);
cnt++;
}
fflush(stdin);
getchar();
return(0);
}
とすればそれなりの(龍神録と似た)数になりますが、これはどうしてでしょうか?
龍神録の中には
s=cnt/100;
の部分が見当たらなくて、そのようなことをしているとは思わないのですが・・・
でも↓の
#include <stdio.h>
int main(){
int cnt;
cnt=0;
while(1){
printf("%d\r",cnt);
cnt++;
}
fflush(stdin);
getchar();
return(0);
}
というコードではあっという間にものすごい数が増えてしまいます。
一応
#include <stdio.h>
int main(){
int cnt,s;
cnt=0;
while(1){
s=cnt/100;
printf("%d\r",s);
cnt++;
}
fflush(stdin);
getchar();
return(0);
}
とすればそれなりの(龍神録と似た)数になりますが、これはどうしてでしょうか?
龍神録の中には
s=cnt/100;
の部分が見当たらなくて、そのようなことをしているとは思わないのですが・・・