上一页 1 ··· 94 95 96 97 98 99 100 101 102 ··· 119 下一页
摘要: 前缀式计算时间限制:1000 ms | 内存限制:65535 KB难度:3描述先说明一下什么是中缀式:如2+(3+4)*5这种我们最常见的式子就是中缀式。而把中缀式按运算顺序加上括号就是:(2+((3+4)*5))然后把运算符写到括号前面就是+(2 *( +(3 4) 5) )把括号去掉就是:+ 2 * + 3 4 5最后这个式子就是该表达式的前缀表示。给你一个前缀表达式,请你计算出该前缀式的值。比如:+ 2 * + 3 4 5的值就是 37输入有多组测试数据,每组测试数据占一行,任意两个操作符之间,任意两个操作数之间,操作数与操作符之间都有一个空格。输入的两个操作数可能是小数,数据保证输入的 阅读全文
posted @ 2012-08-06 09:46 加拿大小哥哥 阅读(333) 评论(0) 推荐(0)
摘要: #include <windows.h>#include <stdio.h>#pragma comment(lib,"winmm.lib")HMIDIOUT handle;unsigned long result = midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL), device = 0; //键盘midiHANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);//鼠标操作HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);DWO 阅读全文
posted @ 2012-08-05 21:33 加拿大小哥哥 阅读(561) 评论(0) 推荐(0)
摘要: 1.string str[]={"Alex","John","Robert"};// creates vector with 10 elements, // and assign value 0 for each vector<int> v3(10,0);vector<string> v4(str+0,str+3); vector<string>::iterator sIt = v4.begin(); while ( sIt != v4.end() ) cout << *sIt++ &l 阅读全文
posted @ 2012-08-05 15:25 加拿大小哥哥 阅读(296) 评论(0) 推荐(0)
摘要: 多边形重心问题时间限制:3000 ms | 内存限制:65535 KB难度:5描述在某个多边形上,取n个点,这n个点顺序给出,按照给出顺序将相邻的点用直线连接, (第一个和最后一个连接),所有线段不和其他线段相交,但是可以重合,可得到一个多边形或一条线段或一个多边形和一个线段的连接后的图形; 如果是一条线段,我们定义面积为0,重心坐标为(0,0).现在求给出的点集组成的图形的面积和重心横纵坐标的和;输入第一行有一个整数0<n<11,表示有n组数据;每组数据第一行有一个整数m<10000,表示有这个多边形有m个顶点;输出输出每个多边形的面积、重心横纵坐标的和,小数点后保留三位; 阅读全文
posted @ 2012-08-03 16:54 加拿大小哥哥 阅读(980) 评论(0) 推荐(1)
摘要: 原型:int isalpha(int ch) (另外的俩个函数格式和这个一样)用法:头文件加入#include <cctype>(C语言使用<ctype.h>功能:判断字符ch是否为英文字母,当ch为英文字母a-z或A-Z时,在标准c中相当于使用“isupper(ch)||islower(ch)”做测试,返回非零值(不一定是1),否则返回零。#include<stdio.h>#include<ctype.h>//string.h不行 #include <conio.h>//getch()int main(){ char ch=' 阅读全文
posted @ 2012-08-02 19:09 加拿大小哥哥 阅读(732) 评论(0) 推荐(0)
摘要: RailsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 18846Accepted: 7515DescriptionThere is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It was possible to establish 阅读全文
posted @ 2012-08-02 17:51 加拿大小哥哥 阅读(1477) 评论(0) 推荐(0)
摘要: ZipperTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 13041Accepted: 4560DescriptionGiven three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two strings can be mixed arbitrarily, but each must stay in it 阅读全文
posted @ 2012-08-02 12:11 加拿大小哥哥 阅读(252) 评论(0) 推荐(2)
摘要: Recaman's SequenceTime Limit: 3000MSMemory Limit: 60000KTotal Submissions: 18575Accepted: 7751DescriptionThe Recaman's sequence is defined by a0 = 0 ; for m > 0, am = am−1 − m if the rsulting am is positive and not already in the sequence, otherwise am = am−1 + m. The first few numbers in 阅读全文
posted @ 2012-08-02 10:28 加拿大小哥哥 阅读(552) 评论(0) 推荐(0)
摘要: BabelfishTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 24748Accepted: 10586DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consist 阅读全文
posted @ 2012-08-01 16:53 加拿大小哥哥 阅读(460) 评论(0) 推荐(0)
摘要: 统计难题Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 10201Accepted Submission(s): 4156Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统 阅读全文
posted @ 2012-08-01 11:06 加拿大小哥哥 阅读(189) 评论(0) 推荐(0)
上一页 1 ··· 94 95 96 97 98 99 100 101 102 ··· 119 下一页