随笔分类 - 编程题
摘要:#include#includeusing namespace std;int a[2000005];int main(){ int n,m; while(scanf("%d",&n)!=EOF) { for(int i=0; i<n; i++) ...
阅读全文
posted @ 2014-04-15 23:24
JKXQJ
摘要:#include#include#includeusing namespace std;int main(){ char a[20],b[20]; while(scanf("%s%s",a,b) != EOF) { int na=0; for(int i=0; a[i]!='\0'; i++) { if(a[i]>='0'&&a[i]='0'&&b[i]<='9') nb=nb*10+b[i]-'0'; else continue;...
阅读全文
posted @ 2014-04-12 23:54
JKXQJ
摘要:#include#include#includeusing namespace std;int main(){ int p,t,g1,g2,g3,gj; while(scanf("%d %d %d %d %d %d",&p,&t,&g1,&g2,&g3,&gj)!=EOF) { if(abs(g1-g2)=t && abs(g3-g2)=t) { printf("%.1f\n",(g3+g1+0.0)/2); } else if(abs(g3-g1)<=t && a..
阅读全文
posted @ 2014-04-11 13:35
JKXQJ
摘要:http://ac.jobdu.com/problem.php?pid=1553/* 时针和分针位mod12,之和再mod6计算大角度, 时针和分针的位置关系分4种情况讨论 然后加上时针小角度的转动。*/#includeint main(){ int h,m; while(scanf("%d%*c%d",&h,&m)!=EOF) { int a=h%12,b=m%12; float k=(m+0.0)/2; float q=(a+0.0)/12-(m*11.0)/(60*12); if(q>0) { ...
阅读全文
posted @ 2014-04-04 07:28
JKXQJ
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 string sortString(string s) 7 { 8 for(int i=0; i=s[j])12 {13 char cmp=s[i];14 s[i]=s[j];15 s[j]=cmp;16 }17 }18 return s;19 }20 int main()21 {2...
阅读全文
posted @ 2013-08-28 11:11
JKXQJ
摘要:http://codeforces.com/problemset/problem/50/A#include#includeusing namespace std;int main(){int n,m,i;while(cin>>m>>n){if(n%2==0)cout<<m*n/2<<endl;elsecout<<m*(n/2)+m/2<<endl;}return 0;}
阅读全文
posted @ 2013-08-20 20:34
JKXQJ
摘要:http://codeforces.com/problemset/problem/118/A 1 #include 2 #include 3 #include 4 using namespace std; 5 string a; 6 queueb; 7 bool is_vowel(char aa) 8 { 9 if(aa=='a' || aa=='e' || aa=='i' || aa=='o' || aa=='u' ||aa=='y'||aa=='A' || aa=='E&
阅读全文
posted @ 2013-08-12 23:05
JKXQJ
摘要:http://codeforces.com/problemset/problem/71/A 1 #include 2 #include 3 using namespace std; 4 string a; 5 int main() 6 { 7 int n; 8 cin>>n; 9 for(int i=0;i>a;12 if(a.length()>10)13 cout<<a[0]<<a.length()-2<<a[a.length()-1]<<endl;14 else15 cout<<a<...
阅读全文
posted @ 2013-08-12 22:30
JKXQJ

浙公网安备 33010602011771号