U E D R , A S I H C RSS

고한종/배열을이용한구구단과제



#include<stdio.h>

int main()
{
	int onOff;
	char keyOnOff;
	onOff=1;

	while(onOff)
	{

		//put your code in here.

		int arr[9]={1,2,3,4,5,6,7,8,9};
		int i;
		int n;
		printf(" . n .");
		scanf("%d",&n);
		
		for(i = 0 ; i < 9 ; i++)
		{
			printf("%d * %d = %d\n",n,arr[i],n*arr[i]);
		}

		//code zone is end.


		printf("행 하? (y/n)\n\n");
		keyOnOff=getch();
		switch(keyOnOff)
		{			
		case 'y':
			onOff=1;
			break;
		case 'n':
			onOff=0;
			break;
		default :
			break;
		}
	}

}

// 히 화 on/off .



  • ㅋㅋㅋ . getch() stdin . fflush(stdin); getch() . n while ?-
  • fflush() output stream , fflush(stdin) MS linux . -
크 : http://k.daum.net/qna/view.html?qid=0DYSq
  • input stream . . -

void trash(void)
{
    int c;

    while ((c=getchar()) != EOF && c != '\n');
}
크 : http://rantis7.egloos.com/2404014
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:43
Processing time 0.0134 sec