php:
((.|\n)*?)
/iU”,$content,$conse);
$w=0;
$o=0;
$l=0;
$d=0;
$y=0;
for($i=0;$i$ans);
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
$result=curl_exec($ch);
preg_match(“/你(.*?)}/iU”,$result,$str);
echo $str[0].”\n”;
?>
python:
#! /usr/bin/env python
#coding=utf-8
import cookielib
import urllib
import urllib2
from bs4 import BeautifulSoup
cookie=cookielib.MozillaCookieJar()
handler=urllib2.HTTPCookieProcessor(cookie)
opener=urllib2.build_opener(handler)
response=opener.open(‘http://ctf.idf.cn/game/pro/37/')
s=BeautifulSoup(response.read(),”lxml”)
query=unicode(s.body.text)
w=query.count(‘w’)-1
o=query.count(‘o’)-1
l=query.count(‘l’)-1
d=query.count(‘d’)-1
y=query.count(‘y’)-1
answer=’%d%d%d%d%d’%(w,o,l,d,y)
value={“anwser”:answer}
DATA=urllib.urlencode(value)
req=urllib2.Request(“http://ctf.idf.cn/game/pro/37/",DATA)
ans=opener.open(req)
text=unicode(BeautifulSoup(ans.read(),”lxml”).body.text)
print text[text.index(u”你”):text.index(‘}’)+1]
java:
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.Connection.Method;
import org.jsoup.Connection.Response;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import java.io.IOException;
class solve{
public static void main(String args[]){
try{
String url=”http://ctf.idf.cn/game/pro/37/";
Map cookies=null;
Response res=Jsoup.connect(url).execute();
cookies=res.cookies();
Document doc=res.parse();
String conse=doc.text();
int w=-1,o=-1,l=-1,d=-1,y=-1;
for(int i=0;i