C/C++の宿題を片付けます 90代目
■ このスレッドは過去ログ倉庫に格納されています
0256デフォルトの名無しさん
2007/06/18(月) 12:59:01#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int stk0[100], stkp=0;
void push(int i){
stk0[stkp++]=i;
}
int pop(void){
return stk0[--stkp];
}
int main(void){
int i, n;
srand((unsigned int)time(NULL));
for(i = 0; i < 10; i++){
n = rand()%100;
printf("%dをpush\n", n);
push(n);
}
for(i = 0; i < 10; i++)
printf("%dをpop\n", pop());
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています