樱初音斗橡皮 @ 2021-05-04 20:28:25
import Data.Char
foldl' :: (b -> a -> b) -> b -> [a] -> b
foldl' _ acc [] = acc
foldl' f acc (x:xs) = foldl' f (f acc x) xs
atoi :: String -> Int
atoi ('-':xs) = -atoi xs
atoi s = foldl' (\acc x -> (acc * 10 + (ord x - ord '0'))) 0 s
split :: String -> (String, String)
split (' ':xs) = ([], xs)
split (x:xs) = (x:(fst ans), snd ans) where ans = split xs
main :: IO()
main = do
input <- getLine
let (a, b) = split input
let i = atoi a
let j = atoi b
print (i + j)
RT,本机和在线 ide 都试过了,都没问题,一提交全 WA
by 樱初音斗橡皮 @ 2021-05-04 20:40:11
感谢各位大佬,已经过了qwq
by int08 @ 2021-06-20 14:53:16
@樱初音斗橡皮
金钩萌新(带雾)
我自感惭愧
by D_M_ @ 2021-06-20 21:36:47
[2017] NOIP普及 一等奖 [2018] NOIP提高 一等奖 [2018] NOIP普及 一等奖 [2019] CSP提高 一等奖 [2019] CSP入门 一等奖 [2020] NOID类 铜牌 [2020] CSP提高 一等奖 [2020] NOIP 二等奖 [2021] WC 金牌
您管这叫萌新?
by lmyedison @ 2021-07-15 06:36:36
你直接这样写它不香吗:
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,b;//不用long long见祖宗
cin>>a>>b;
printf(a+b);
return 0;//养成好习惯
}
by kiki5 @ 2021-07-15 14:11:48
你们写c++嘛!
by lzjqwq @ 2021-07-17 15:54:20
[2017] NOIP普及 一等奖
[2018] NOIP提高 一等奖
[2018] NOIP普及 一等奖
[2019] CSP提高 一等奖
[2019] CSP入门 一等奖
[2020] NOID类 铜牌
[2020] CSP提高 一等奖
[2020] NOIP 二等奖
[2021] WC 金牌
真·“萌·新”·啊
by Sliarae @ 2021-08-07 13:15:57
qndmx
by MarvinWang @ 2022-01-29 22:19:38
@lmyedison 不见祖宗,这题数据int够了