U E D R , A S I H C RSS

CodeRace/2015.5.15/S'팀 (rev. 1.10)

Code Race/2015.5.15/S'팀

스팀은 좋은겁니다

#include<stdio.h>
int main()
{
	int k;

	int j;
	scanf("%d",&k);
	j = sum(k);

	printf("1부터 100의 합은 : %d\n",j);
	return 0;
	
}

int sum(int n)
{
	int a = 0;
	if (n == 0)
	{
		return n;
	}
	else
	{
		a += n;
		a += sum(n - 1);

	}
	return a;
}




문제 2


header.h


#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#pragma warning(disable:4996)


int teamname(void)
{
	printf("    ::##==\n		::## +=\n		.**# +=\n		. + ** *= +\n		. + *+# = :\n	.*++*##         ...\n		*++*+.. : *..\n		= ******+%@::. ...: ::\n		= .  ::%****#*@%#%%#%#%%%+# + ...\n##                    *==++#***..\n		.++**:\n");
	printf("팀명: S'팀\n");
	printf("팀원: 서영운, 송준호, 유재범\n");
	for (int i = 0; i < 40; i++)
		printf("#");
	printf("\n");
	return 0;
}



void gugu(void){
	int rand_num = 0;
	srand((unsigned)time(NULL));

	int count = 0; // 입력받은거

	printf(" 숫자를 입력하세요.\n");
	scanf("%d", &count);

	for (int k = 0; k < count; k++){
		rand_num = rand() % 9 + 1;
		printf("%d\n", rand_num);
		for (int i = 1; i < 10; i++){
			printf("%d * %d = %d\n", i, rand_num, i*rand_num);
		}
	}
}

소스.c
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include "header.h"
#pragma warning(disable:4996)


int main()
{
	teamname();
	gugu();
	return 0;
}


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:22:56
Processing time 0.0161 sec