#include<bits/stdc++.h> using namespace std; const int N=1e8+50; char a[N]; inline void solve1() { gets(a); } inline void solve2() { scanf("%s",&a); } inline void solve3() { char ch; while(ch!='\n') ch=getchar(); } inline void solve4() { int i=0; while(~scanf(" %c",&a[i])) i++; } int main() { freopen("judge.txt","r",stdin); clock_t s,t; s=clock(); //solve1(); //solve2(); //solve3(); solve4(); t=clock(); cout<<t-s<<endl; return 0; }
(大部分測試內容於評測鴨上進行)c++
如下爲測試內容:(單位:ms)測試
數據大小:10000spa
(gets字符串):0.040394code
(scanf字符串):0.051836ci
(getchar單字符):0.057788字符串
(scanf單字符):0.533744get
數據大小:100000it
(gets字符串):0.149481class
(scanf字符串):0.229154循環
(getchar單字符):0.315258
(scanf單字符):5.139085
數據大小:1000000
(gets字符串):5
(scanf字符串):56
(getchar單字符):48
(scanf單字符):324數據大小:100000000
(gets字符串):661
(scanf字符串):5215
(getchar單字符):4426
(scanf單字符):31578
(本測試僅供參考)