옆으로 나오는 구구단

~cpp 
#include<iostream.h>
int main()
{
	int i;
	int j;
	for(j=0;j<9;j++){
		for(i=2;i<6;i++)
			{cout<<i<<"*"<<j+1<<"="<<i*(j+1)<<"\t";}
		cout<<"\n";	}
	cout<<"\n";
	for(j=0;j<9;j++){
		for(i=6;i<10;i++)
			{cout<<i<<"*"<<j+1<<"="<<i*(j+1)<<"\t";}
		cout<<"\n";	}

}

소수구하기

Factorial

소트

~cpp #include<iostream.h>
main()
{
	int i,j;
	int temp;
	int array[]={1,4,2,53,25,12,43,12,44,3};
	for(i=0;i<10;i++)
		cout<<array[i]<<" ";
	cout<<"\n";
	for(j=0;j<10;j++){
	for(i=0;i<10;i++){		
		if(array[i]<array[i+1]){
			temp=array[i];
			array[i]=array[i+1];
			array[i+1]=temp;}
	}}

	for(i=0;i<10;i++){
		cout<<array[i]<<" ";
	}
}

작성자: Yggdrasil
Retrieved from http://wiki.zeropage.org/wiki.php/Yggdrasil/020515세미나
last modified 2021-02-07 05:28:28