1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include <stdio.h>
#include <conio.h>

int main(){
    bool Output=true;
    int ch=0;
    do{
        ch = 0;
        if(_kbhit()) ch  = _getch();//環境依存コード。
        if(ch == 'p') Output = !Output;
        if(Output) printf("A");
    }while(ch != 'q');

}