B / Y / U / S
HOME À¥ È£½ºÆà µµ¸ÞÀÎ ¸Å´º¾ó °í°´Áö¿ø ¼³Á¤Á¤º¸ °èÁ¤½Åû 2024-12-27 Friday 
À¥ È£½ºÆÃ
# °øÁö »çÇ×
# ÀÚÁÖ ¹¯´Â Áú¹®
# Áú¹®°ú ´äº¯
# °¡ÀÔ ¹®ÀÇ
Ä¿¹Â´ÏƼ
# ÀÚÀ¯°Ô½ÃÆÇ
# ¸®´ª½ºÆÁ
# ¾ÆÀÌÅ¥ Å×½ºÆ®
# ³»È¨ ¼Ò°³
# °Ö·¯¸®
# ÀÚ·á½Ç

  ¸®´ª½ºÆÁ  Go Unix Power Tools Online Book Go Bash Guide
Read No. 133 article 2002-03-18 20:05:39
NickName   Ç®ºñ´©
Subject   [¸®Æ÷Æ®] ÇÇŸÄÚ¶ó½ºÁ¤¸® ¸¸Á·ÇÏ´Â º¯¼ö ±¸Çϱâ (c¾ð¾î)
// ÇÇŸ°í¶ó½ºÀÇ Á¤¸®¸¦ ¸¸Á·ÇÏ´Â ¼¼ º¯¼ö¸¦ ã´Â ¹®Á¦
// µÎ º¯¼öÀÇ Á¦°öÀÇ ÇÕÀÌ ´Ù¸¥ ÇÑ º¯¼öÀÇ Á¦°ö°ª°ú °°Àº ¼¼ º¯¼ö¸¦ ã´Â ¹®Á¦ÀÓ
// ºøº¯ º¯¼öÀÇ °ªÀÇ Å©±â(500À» ³ÑÁö¾ÊÀº ¼ö)¿¡ µû¶ó Á¤·ÄµÇµµ·Ï ÇÏ¿´½À´Ï´Ù.

#include <stdio.h>
main() {
	int side1,side2,hypotenuse; // ¼¼ º¯¼ö¸¦ ÇÒ´ç
	
	for ( hypotenuse=1 ; hypotenuse <= 500; hypotenuse++ ) { // ºøº¯À» ÃÖ´ë°ªÀ¸·Î ¼³Á¤
		for ( side1=1 ; side1 <= hypotenuse ; side1++ ) {    // ºøº¯À» ÃÖ´ë°ªÀ¸·Î 
¼³Á¤
			for ( side2=1 ; side2 <= side1 ; side2++ ) { // Áߺ¹À» ÁÙÀ̱â À§
ÇØ º¯¼öÅ©±â Á¦ÇÑ
				if ( side1*side1 + side2*side2 == 
hypotenuse*hypotenuse )
					printf ( "%d,%d,%d\n",side2,side1,hypotenuse );
			}
		}
	}
}
Regist Addr [ 192.168.0.2 ] ¸ñ·Ïº¸±â À­±Û ¾Æ·§±Û
Á¤±ÔÇ¥Çö½Ä [ »ó¼¼ °Ë»ö ]
Page Loading [ 0.02 Sec ] SQL Time [ 0 Sec ]

Copyleft 1999-2024 by JSBoard Open Project
Theme Designed by IDOO And follow GPL2

°³ÀÎÁ¤º¸ Ãë±Þ¹æħ ÀÌ¿ë ¾à°ü »çÀÌÆ® ¸Ê ¾îµå¹Î °ü¸®