码迷,mamicode.com
首页 >  
搜索关键字:cin    ( 7874个结果
HDOJ 1062 Rightmost Digit
【题意】求N^N,输出最右边的那一位。 【代码1:获得周期】 #include #include #include #include #include using namespace std; int main() { int N = 0; cin >> N; while (N--) { int mul = 1, n = 0, r =...
分类:Web程序   时间:2015-01-31 12:57:52    阅读次数:198
深入了解scanf/getchar/gets/cin等函数
scanf(), getchar()等都是标准输入函数,一般人都会觉得这几个函数非常简单,没什么特殊的。但是有时候却就是因为使用这些函数除了问题,却找不出其中的原因。下面先看一个很简单的程序: 程序1: #include int main() { char ch1, ch2; scanf("%c", &ch1); scanf("%c", &ch2); printf("%d %d...
分类:其他好文   时间:2015-01-30 16:14:27    阅读次数:136
求两个数是否互质及最大公约数
1 #include 2 using namespace std; 3 4 int main() 5 { 6 int a, b, c; 7 cin >> a >> b; 8 while(b != 0) { 9 c = a % b;10 ...
分类:其他好文   时间:2015-01-30 15:07:00    阅读次数:164
HDU2139 Calculate the formula【水题】
题目大意:给你一个奇数N,求1~N中奇数的平方和。 思路:直接暴力超时了,所以用公式来做 S = N*(N+1)*(N+2)/6,因为结果不超int型, 但是中间过程会超一些,所以用__int64来做就可以了。注意cin、cout会超时,用scanf 和printf就可以了。...
分类:其他好文   时间:2015-01-29 22:36:22    阅读次数:247
poj 1163 查找最大结点
#include #include using namespace std;void print_value(int a[][110],int N){ for(int row=1; row>a[row][line];}int main(){ int N; cin>>N; int value[110]...
分类:其他好文   时间:2015-01-29 13:58:01    阅读次数:149
hdu 火车入队 stack
#include #include #include #include #include using namespace std;int main(){ int n; //string in,out; char in[1000],out[1000]; while(cin>>n>>in>>out) {...
分类:其他好文   时间:2015-01-29 12:17:45    阅读次数:200
hdu 2527
#include #include #include using namespace std;int main(){ int n; cin>>n; while(n--) { map count; map::iterator iter; int m; string temp; cin>>m>>temp...
分类:其他好文   时间:2015-01-29 12:08:50    阅读次数:170
杭电2019
#include #include #include #include #include #include #include #include using namespace std;int main(){ list a; int n,m,t; while(cin >> n >> ...
分类:其他好文   时间:2015-01-27 21:46:57    阅读次数:189
TJU Problem 1644 Reverse Text
注意: int N; cin >> N; cin.ignore(); 同于 int N;scanf("%d\n",&N);另:关于 cin 与 scanf:scanf是格式化输入,printf是格式化输出。cin是输入流,cout是输出流。效率稍低,但书写简便。格式化输出效率比较高,但是写代码...
分类:其他好文   时间:2015-01-27 21:44:24    阅读次数:176
TJU Problem 2520 Quicksum
注意: for (int i = 1; i 2 #include 3 #include 4 using namespace std; 5 6 int main() { 7 string aaa; int sum = 0; 8 while (getline(cin...
分类:其他好文   时间:2015-01-27 19:58:53    阅读次数:164
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!