<pre style="margin:0px;line-height:125%;"><span style="color:rgb(136,136,136);">#include<stdio.h></span><span style="color:rgb(136,136,136);">#include<stdlib.h></span><span style="color:rgb(136,136,136);">#pragma warning(disable:4996)</span> void <span style="color:rgb(0,112,32);">max</span>(<span style="color:rgb(0,112,32);">int</span> <span style="color:rgb(51,51,51);">*</span>a[], <span style="color:rgb(0,112,32);">int</span> b) //최대 { <span style="color:rgb(0,112,32);">int</span> i, <span style="color:rgb(0,112,32);">max</span> <span style="color:rgb(51,51,51);">=</span> a[<span style="color:rgb(0,0,221);font-weight:bold;">1</span>]; <span style="color:rgb(0,136,0);font-weight:bold;">for</span> (i <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; i<span style="color:rgb(51,51,51);"><</span>b; i<span style="color:rgb(51,51,51);">++</span>) { <span style="color:rgb(0,136,0);font-weight:bold;">if</span> (<span style="color:rgb(0,112,32);">max</span> <span style="color:rgb(51,51,51);"><</span> a[i]) <span style="color:rgb(0,112,32);">max</span> <span style="color:rgb(51,51,51);">=</span> a[i]; } printf(<span style="background-color:rgb(255,240,240);">"</span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);"> "</span>, <span style="color:rgb(0,112,32);">max</span>); } void <span style="color:rgb(0,112,32);">min</span>(<span style="color:rgb(0,112,32);">int</span> <span style="color:rgb(51,51,51);">*</span>a[], <span style="color:rgb(0,112,32);">int</span> b) //최소 { <span style="color:rgb(0,112,32);">int</span> i, <span style="color:rgb(0,112,32);">min</span> <span style="color:rgb(51,51,51);">=</span> a[<span style="color:rgb(0,0,221);font-weight:bold;">1</span>]; <span style="color:rgb(0,136,0);font-weight:bold;">for</span> (i <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; i<span style="color:rgb(51,51,51);"><</span>b; i<span style="color:rgb(51,51,51);">++</span>) { <span style="color:rgb(0,136,0);font-weight:bold;">if</span> (<span style="color:rgb(0,112,32);">min</span> <span style="color:rgb(51,51,51);">></span> a[i]) <span style="color:rgb(0,112,32);">min</span> <span style="color:rgb(51,51,51);">=</span> a[i]; } printf(<span style="background-color:rgb(255,240,240);">"</span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);"> "</span>, <span style="color:rgb(0,112,32);">min</span>); } void main() { <span style="color:rgb(0,112,32);">int</span> i, j, a_test, n_test; <span style="color:rgb(0,112,32);">int</span> <span style="color:rgb(51,51,51);">*</span>x; <span style="color:rgb(0,112,32);">int</span> <span style="color:rgb(0,112,32);">sum</span> <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">0</span>; scanf(<span style="background-color:rgb(255,240,240);">"</span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);">"</span>, <span style="color:rgb(51,51,51);">&</span>a_test); <span style="color:rgb(0,136,0);font-weight:bold;">for</span> (i <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; i<span style="color:rgb(51,51,51);"><</span>a_test; i<span style="color:rgb(51,51,51);">++</span>) { scanf(<span style="background-color:rgb(255,240,240);">"</span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);">"</span>, <span style="color:rgb(51,51,51);">&</span>n_test); x <span style="color:rgb(51,51,51);">=</span> (<span style="color:rgb(0,112,32);">int</span><span style="color:rgb(51,51,51);">*</span>)malloc(n_test<span style="color:rgb(51,51,51);">*</span>sizeof(<span style="color:rgb(0,112,32);">int</span>)); <span style="color:rgb(0,136,0);font-weight:bold;">for</span> (j <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; j<span style="color:rgb(51,51,51);"><</span>n_test; j<span style="color:rgb(51,51,51);">++</span>) { scanf(<span style="background-color:rgb(255,240,240);">"</span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);"> "</span>, <span style="color:rgb(51,51,51);">&</span>x[j]); <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">총점</span> <span style="color:rgb(0,112,32);">sum</span> <span style="color:rgb(51,51,51);">+=</span> x[j]; } printf(<span style="background-color:rgb(255,240,240);">"</span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);"> "</span>, <span style="color:rgb(0,112,32);">sum</span>); <span style="color:rgb(0,112,32);">max</span>(x, j); <span style="color:rgb(0,112,32);">min</span>(x, j); printf(<span style="background-color:rgb(255,240,240);">"</span><span style="color:rgb(102,102,102);font-weight:bold;background-color:rgb(255,240,240);">\n</span><span style="background-color:rgb(255,240,240);"> "</span>); } }</pre><pre style="margin:0px;line-height:125%;"> </pre><pre style="margin:0px;line-height:125%;">이 프로그램은</pre><pre style="margin:0px;line-height:125%;">input output</pre><pre style="margin:0px;line-height:125%;">3 66 33 11</pre><pre style="margin:0px;line-height:125%;">11 22 33 17 7 2</pre><pre style="margin:0px;line-height:125%;">4 150 44 10</pre><pre style="margin:0px;line-height:125%;">2 5 7 3</pre><pre style="margin:0px;line-height:125%;">6</pre><pre style="margin:0px;line-height:125%;">10 30 11 22 44 33</pre><pre style="margin:0px;line-height:125%;"> </pre><pre style="margin:0px;line-height:125%;">이렇게 출력 됩니다</pre><pre style="margin:0px;line-height:125%;">output쪽에서는 순서대로 총합,최대값,최소값을 출력합니다.</pre><pre style="margin:0px;line-height:125%;">총합은 그냥 메인 안에서 돌렸구요 최대최소는 함수를 써서 했습니다.</pre><pre style="margin:0px;line-height:125%;">그런데 이렇게 하니까 </pre><pre style="margin:0px;line-height:125%;"></pre><div style="text-align:left;"><img width="800" height="111" class="chimg_photo" style="border:;" alt="캡처.PNG" src="http://thimg.todayhumor.co.kr/upfile/201503/1426476909ScByLi7kRWtiqS3b8BokU9DJreyESoW.png"></div> <div><br>이런 에러가 나네요</div> <div>으으 형식 에러라는데 어디가 잘못된건지 감이 안와요 ㅠㅠ</div> <div>구글링 해도 잘 안나오네요...</div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.