ÃßõµÇ¾ú½À´Ï´Ù.
|
´ÜÃà URL: https://humoruniv.com/program6387 URL º¹»ç |
¿ì¼± ÀÌ·± ¹®Á¦Àä. ÀúÈñ Çб³¿¡¼´Â OJ ½Ã½ºÅÛÀ̶ó´Â º°µµÀÇ È¨ÆäÀÌÁö¿¡ °¡¼ ½Ç½À¹®Á¦³ª °úÁ¦¸¦ Á¦ÃâÇÑ ÈÄ 0Á¡~100Á¡ »çÀÌ¿¡¼ º»ÀÎÀÇ Á¡¼ö¸¦ ¾Ë·ÁÁÝ´Ï´Ù.
±×·±µ¥ Àú´Â ÀÚ²Ù 90Á¡¹Û¿¡ ³ª¿ÀÁö ¾Ê³×¿ä. ÀÌ°Ç ¾ÆÁÖ ¹Ì¹¦ÇÑ ¹ö±×°¡ ÀÖ´Ù´Â °Çµ¥ ãÁú ¸øÇϰڽÀ´Ï´Ù¤Ð¤Ð
Á¦°¡ § ÄÚµå´Â ¾Æ·¡¿¡ ÀÖ½À´Ï´Ù. ¾î¶°ÇÑ ºÎºÐÀÌ À߸øµÈ°ÇÁö ÈùÆ®³ª ÁöÀûÀ» ÇØ ÁÖ½Ã¸é °¨»çÇϰڽÀ´Ï´Ù.
#include<stdio.h>
int max1, max2;
void update_max(int x) {
if (max1 == x) max2 = x;
if (max1 < x) {
max2 = max1;
max1 = x;
}
if (max1 > x&&x > max2) {
max2 = x;
}
}
int main() {
int a, b;
scanf("%d", &max1);
scanf("%d", &max2);
if (max2 > max1) {
a = max1;
max1 = max2;
max2 = a;
}
scanf("%d", &b);
if (b == 0) {
update_max(b);
printf("%d %d", max1, max2);
}
else {
update_max(b);
while (b != 0) {
scanf("%d", &b);
if (b == 0)break;
update_max(b);
}
update_max(b);
printf("%d %d", max1, max2);
}
return 0;
}
|
¡ã ´ÙÀ½±Û | °³¹ßÀÚ´Â delete Äõ¸®¸¦Â®´Ù. | solum |
![]() ![]() ![]() ![]() |
2018-09-10 [08:41] |
¡å ÀÌÀü±Û | ÇÁ·Î±×·¡¹Ö¿ë ³ëÆ®ºÏ¿¡ ·¥ ÇÊ¿ä¾øÁö ¾Ê³ª¿ä? | ¸»À̻ڰÔÇØ |
![]() ![]() ![]() ![]() |
2018-09-08 [18:57] |
![]() |
½Ã¹Î»èÁ¦ |
Á¶±×¸¸ ÈùÆ®¶óµµ °¨»çÇÏ°Ô µè°Ú½À´Ï´Ù~~
|
10 |
![]() ![]() ![]() ![]() |
2018-09-10 |
![]() |
ÇÁ·Î¸Á»ó·¯ |
-2 -3 0 ÀÔ·ÂÇß´Ù°í °¡Á¤Çϸé¿ä if (b==0) update_max (b) ÀÌ ÇÔ¼ö¶§¹®¿¡ 0 -2 °¡ Ãâ·ÂµÇ´Â°Í°°³×¿ä ÀÔ·ÂµÈ ¼ö°¡ ÀüºÎ ¸¶À̳ʽº À϶§ ¿À·ù°¡ ³ª´Â°Í °°¾Æ¿ä
|
00 |
![]() ![]() ![]() ![]() |
2018-09-10 |
![]() |
![]() ¿ø·¡°³»õ³¢ |
À̰ÅÀϼöµµÀÖ°Ú´Ù ±Ùµ¥ ¹®Á¦°¡ ¾Ö¸ÅÇÏ³× ³¹è¿ï¶§ Àü¿ªº¯¼ö´Â ÁøÂ¥ ¾²Áö¸»¶ó°í ¹è¿ö¼ ½Ì±ÛÅæµµ °ÅÀÇ ¾È¾²´Âµ¥
|
00 |
![]() ![]() ![]() |
2018-09-10 |
![]() |
![]() ¿ø·¡°³»õ³¢ |
¾Æ »ý°¢Çغ¸´Ï Çб⠿ÏÀü ÃʹÝÀÌ¶ó ½ºÅ³ÀÌ ºÎÁ·Çؼ ±ÛÄí³ª
|
00 |
![]() ![]() ![]() |
2018-09-10 |
![]() |
![]() ½Ã¹Î»èÁ¦ |
ÈùÆ® °¨»çÇÕ´Ï´Ù~~ ´öºÐ¿¡ ÇØ°áÇß¾î¿ä
|
10 |
![]() ![]() ![]() |
2018-09-10 |
![]() |
¿ø·¡°³»õ³¢ |
¾Æ´Ï¸é Àü¿ªº¯¼ö¼±¾ðÇÒÅÂÃʱâÈ ¾ÈÇØÁà¼? –2,147,483,648
|
10 |
![]() ![]() ![]() ![]() |
2018-09-10 |
![]() |
¿ø·¡°³»õ³¢ |
#include <stdio.h> int max1 = -2147483648, max2 = -2147483648; void update_max(int input); int main() { int input; scanf("%d", &input); while (input != 0) { update_max(input); scanf("%d", &input); } printf("Max1 = %d , Max2 = %d", max1, max2); return 0; } void update_max(int input) { if (input > max1) { max2 = max1; max1 = input; } else if (max1 >= input && input > max2) { max2 = input; } }
|
00 |
![]() ![]() ![]() ![]() |
2018-09-10 |
![]() |
![]() ¿ø·¡°³»õ³¢ |
ÀÌ°Ç ¸îÁ¡ ³ª¿À³ª ÇØ¢a ±Ã±ÝÇØ
|
00 |
![]() ![]() ![]() |
2018-09-10 |
![]() |
![]() ½Ã¹Î»èÁ¦ |
Ʋ·È´Ù°í ³ª¿À³×¿ä..
|
00 |
![]() ![]() ![]() |
2018-09-10 |
![]() |
![]() ¿ø·¡°³»õ³¢ |
¾ÈµÈ´Ù°í?
|
00 |
![]() ![]() ![]() |
2018-09-10 |
![]() |
![]() ½Ã¹Î»èÁ¦ |
È÷ÀÍ
|
00 |
![]() ![]() ![]() |
2018-09-10 |
![]() |
ÄÚµùºô·± |
¹è¿·Î ÀúÀåÇØ¼ Á¤·ÄÇÏ¸é µÉ²¨°°Àºµ¥¿©????
|
00 |
![]() ![]() ![]() ![]() |
2018-09-11 |
¡ã ´ÙÀ½±Û | °³¹ßÀÚ´Â delete Äõ¸®¸¦Â®´Ù. | solum |
![]() ![]() ![]() ![]() |
2018-09-10 [08:41] |
¡å ÀÌÀü±Û | ÇÁ·Î±×·¡¹Ö¿ë ³ëÆ®ºÏ¿¡ ·¥ ÇÊ¿ä¾øÁö ¾Ê³ª¿ä? | ¸»À̻ڰÔÇØ |
![]() ![]() ![]() ![]() |
2018-09-08 [18:57] |