편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.
최신판 | 당신의 편집 | ||
1번째 줄: | 1번째 줄: | ||
==C== | ==C== | ||
{{카타|8급|C|5}} | {{카타|8급|C|5}} | ||
< | <source lang='C'> | ||
#include <stddef.h> | #include <stddef.h> | ||
void count_positives_sum_negatives( | void count_positives_sum_negatives( | ||
10번째 줄: | 10번째 줄: | ||
} | } | ||
} | } | ||
</ | </source> | ||
< | <source lang='C'> | ||
#include <stddef.h> | #include <stddef.h> | ||
void count_positives_sum_negatives( | void count_positives_sum_negatives( | ||
24번째 줄: | 24번째 줄: | ||
*negativesSum = negSum; | *negativesSum = negSum; | ||
} | } | ||
</ | </source> | ||
==C++== | ==C++== | ||
{{카타|8급|C++|4}} | {{카타|8급|C++|4}} | ||
< | <source lang='cpp'> | ||
#include <vector> | #include <vector> | ||
39번째 줄: | 39번째 줄: | ||
return {posCnt, negSum}; | return {posCnt, negSum}; | ||
} | } | ||
</ | </source> | ||
< | <source lang='cpp'> | ||
#include <vector> | #include <vector> | ||
56번째 줄: | 56번째 줄: | ||
return res; | return res; | ||
} | } | ||
</ | </source> | ||
==Kotlin== | ==Kotlin== | ||
{{카타|8급|Kotlin|2}} | {{카타|8급|Kotlin|2}} | ||
< | <source lang='kotlin'> | ||
</source> | |||
<source lang='kotlin'> | |||
</source> | |||
</ | |||
< | |||
</ | |||
==PHP== | ==PHP== | ||
<source lang='php'> | |||
< | |||
function countPositivesSumNegatives($input) { | function countPositivesSumNegatives($input) { | ||
if (empty($input)) return []; | if (empty($input)) return []; | ||
104번째 줄: | 76번째 줄: | ||
return [$posCount, $negSum]; | return [$posCount, $negSum]; | ||
} | } | ||
</ | </source> | ||
< | <source lang='php'> | ||
function countPositivesSumNegatives($input) { | function countPositivesSumNegatives($input) { | ||
$count = count($input); | $count = count($input); | ||
117번째 줄: | 89번째 줄: | ||
return [$posCount, $negSum]; | return [$posCount, $negSum]; | ||
} | } | ||
</ | </source> |