3、从键盘上接收一个字母,判断是否是大写字母,如果是则转换成小写字母输出,否则直接输出#include void main(){ char x=0; printf("请输入一个字母:"); scanf("%c",&x); x>=65&&x<=90? printf("小写字母为:%c",x+32...
分类:
其他好文 时间:
2014-08-14 00:48:37
阅读次数:
207
题意:。。。
策略:最简单的典型的巴什博弈。
代码:
#include
int main()
{
int n, m;
int t;
scanf("%d", &t);
while(t --){
scanf("%d%d", &n, &m);
if(n%(m+1) == 0){
printf("Rabbit\n...
分类:
其他好文 时间:
2014-08-13 22:30:57
阅读次数:
194
101两点距离时间限制:3000 ms | 内存限制:65535 KB 难度:1描述 输入两点坐标(X1,Y1),(X2,Y2)(0#include main(){ int N ; float a,b,c,d; double s; scanf("%d\n",&N);...
分类:
其他好文 时间:
2014-08-13 22:16:47
阅读次数:
476
#include #include using namespace std;int dp[50];int main(){ int n,m; while(1) { scanf("%d%d",&n,&m); if(n==0&&m==0) break; ...
分类:
其他好文 时间:
2014-08-13 22:07:27
阅读次数:
151
题目:有一些山,在一个平面山,给你每个山峰的坐标,太阳从右边照过来,被照到的线段的长度和。
分析:计算几何、贪心。首先,按很坐标排序;然后,每次找到左边第一个比它高的山峰,
求出对应的照射长度,求和即可。
说明:while(scanf("%d",&t))导致TLE,╮(╯▽╰)╭。
#include
#include
#include
#include
#i...
分类:
其他好文 时间:
2014-08-13 18:53:27
阅读次数:
197
1.不可读入空格#include#includeusing namespace std;int main(){ char c[50]; scanf("%s",c); printf("%s",c); return 0;}2.可以读入空格用字符 ^ 可以说明补集。把 ^ 字符放为扫描集的第一字符时,构成...
分类:
其他好文 时间:
2014-08-13 17:36:06
阅读次数:
159
1.long longVC中不能用,codeblocks中 可以#include#includeusing namespace std;int main(){ long long a; scanf("%lld",&a); printf("%lld",a); return 0;}2.__int64VC...
分类:
其他好文 时间:
2014-08-13 17:32:37
阅读次数:
190
需要连续从标准输入读取数据时,可以采用下面两种不同的方式判断文件结束:[cpp]view plaincopyintwhile"%d"dowhiledo首 先看scanf,当成功读取时返回读取的项的数目,如:scanf("%d %d",&i,&j)返回2,scanf("%d %f %s",&i, &f...
分类:
其他好文 时间:
2014-08-13 14:49:56
阅读次数:
270
时间限制:0.25s空间限制:4M题意: 在n(1const int INF = 300 + 9;int g[INF][INF], f[INF][INF];int n, m, i, j, k, t;int main() { scanf ("%d%d", &n, &m); t = (m + 1) .....
分类:
其他好文 时间:
2014-08-13 14:49:26
阅读次数:
182
首先, string类型变量 不能用scanf 输入。1.字符数组char a[20]忽略回车,忽略空格,int main(){char a[20];scanf("%s",a);printf("%s",a);// 输出字符串a中的字符return 0;}2.单个字符char a-----------...
分类:
其他好文 时间:
2014-08-13 14:44:56
阅读次数:
180