var i,j,k,n,ans,p,len,chk,zh:longint; ch:char; s:string; a:array[1..100] of longint; begin readln(ch); chk:=ord(ch)-96; readln(n); for i:=1 to n do begin readln(s); p:=pos(' ',s); val(copy(s,p+1,length(s)-p),k); delete(s,p,length(s)-p+1); len:=length(s); k:=-1*k mod 26; for j:=1 to len do begin zh:=(ord(s[j])-96+k+26) mod 26; if zh=0 then zh:=26; if zh=chk then ans:=ans+1; end; end; writeln(ans); end. /************************************************************** Problem: 1066 User: wxy Language: Pascal Result: 正确 Time:0 ms Memory:744 kb ****************************************************************/
1066: 单词游戏(game)
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
51Nod1066 Bash游戏(Bash Game:同余理论)
博弈论中Bash Game:同余理论,就是关于这个游戏b>using namespace std;...
基础题 同余理论 #include ci ios -
游戏game
1.log4cxx 日志 2.protobuf 数据交互(类似json 3.boost.asio 网络库 4.boost.python 脚本支持 5.语法树 + c++处理excel资源
语法树 数据交互 c++ json python