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.0100 sec