[ create a new paste ] login | about

Link: http://codepad.org/8wjz7oJL    [ raw code | fork ]

C, pasted on Feb 20:
#include<stdio.h>
#include<string.h>
int main(void){
	char tanto[128], tanto_t[1000][128];
	int uriage_t[1000];
	int uriage, goukei = 0;
	int i, count = 0;
	/* 入力 */
	printf("-----入力-----\n");
	do{
		printf("担当者を入力 ->");
		scanf("%s",tanto);
		if(!strcmp(tanto, "end")) break;
		
		printf("売り上げを入力 ->");
		scanf("%d",&uriage);
		
		goukei = goukei + uriage;
		uriage_t[count] = uriage;
		strcpy(tanto_t[count],tanto);
		count++;
	}while(1);
	/* 結果表示 */
		printf("-----結果-----\n");
	for(i=0; i<count; i++){
		printf("担当者名:%s\n",tanto_t[i]);
		printf("売り上げ:%d\n",uriage_t[i]);
	}
		printf("--------------\n");
	
	printf("売上合計:%d\n",goukei);
	return 0;
}


Create a new paste based on this one


Comments: