作者Nessa1103 (紫藤)
看板Programming
标题Fw: [徵求] 请帮我看我程式习题理解得对不对
时间Wed Mar 11 18:35:27 2015
※ [本文转录自 Wanted 看板 #1L019pP7 ]
作者: Nessa1103 (紫藤) 看板: Wanted
标题: [徵求] 请帮我看我程式习题理解得对不对
时间: Wed Mar 11 18:01:20 2015
有个程式语言的习题要求如下:
Description
We want to calculate a sum of squares of some integers, excepting negatives
The first line of the input will be an integer N (1 <= N <= 100)
Each of the following N test cases consists of one line containing an integer
X (0 < X <= 100), followed by X integers (Yn, -100 <= Yn <= 100)
space-separated on the next line
For each test case, calculate the sum of squares of the integers excepting
negatives, and print the calculated sum to the output. No blank line between
test cases
(Take input from standard input, and output to standard output)
他的意思是要我把他给的输入范例除了负的以外通通平方加起来吗?
因为他「输入」的范例给了五行,可是输出的部分只有两行。
因为这部分卡住,所以不知道该怎麽写。
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 123.193.69.208
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Wanted/M.1426068083.A.647.html
※ 发信站: 批踢踢实业坊(ptt.cc)
※ 转录者: Nessa1103 (123.193.69.208), 03/11/2015 18:35:27
1F:→ alibuda174: 照我的理解,输出两行的话,输入应该 220.137.225.69 03/11 19:08
2F:→ alibuda174: 三行; 而且第一行是「2」 220.137.225.69 03/11 19:09
3F:→ alibuda174: 嗯,我说错了,下一篇应该是正解 220.137.225.69 03/11 20:29