Problem Description
A while ago it was quite cumbersome to create a message for the Short Message Service (SMS) on a mobile phone. This was because you only have nine keys and the alphabet has more t...
分类:
移动开发 时间:
2014-07-26 02:40:36
阅读次数:
332
来源:点击打开链接
很简单,找规律。
每去掉一个点,点的总数量就减去n+m-1,然后看谁最先减到没有点可减,就可以了。
#include
#include
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
int totalpoint=n*m;
int count=0;
while(totalpoint>0)
{
...
分类:
其他好文 时间:
2014-07-26 02:18:56
阅读次数:
202
ll T;
while(~scanf("%d",&T)){
while(T--) {
= = ...
思路:
用秩合并,看了题解才发现 if(fx == fy)要输出当前集合的秩而不是0。。。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#inc...
分类:
其他好文 时间:
2014-07-26 02:14:47
阅读次数:
222
#include
main()
{
float x,amax,amin;
scanf("%f",&x);
amax=x;amin=x;
while(x>=0)
{
if(x>amax)amax=x;
if(x<amin)amin=x;
scanf("%f",&x);
}
printf("\namax=%f\namin=%f\n",amax,amin);
}...
分类:
其他好文 时间:
2014-07-26 02:07:06
阅读次数:
179
#include
long fun(long num)
{
long k=1;
do
{
k*=num%10;
num/=10;
}
while(num>0);
return k;
}
main()
{
long n;
printf("please enter a number:");
scanf("%ld",&n);
printf("\n%ld\n",fun(n));...
分类:
其他好文 时间:
2014-07-26 02:06:06
阅读次数:
247
代码如下:
#include
#include
int dp[10000];
int max(int a,int b)
{return a>b?a:b;}
int main()
{
int w[4];
int i,j,t,n;
scanf("%d",&t);
w[0]=150,w[2]=200,w[3]=350;
while(t--)
{
...
分类:
其他好文 时间:
2014-07-26 01:57:36
阅读次数:
251
题目描述:输入N个学生的信息,然后进行查询。输入:输入的第一行为N,即学生的个数(Nusing namespace std; //# include# include# include/*int main(){ int n; while (cin >> n) { } ...
分类:
其他好文 时间:
2014-07-26 01:49:16
阅读次数:
223
#include #include #include using namespace std;int main(){double c,h,o,n;int t,i,j;cin>>t;getchar();double ans;char s[100];while (t-->0){gets(s);c=0;h...
分类:
其他好文 时间:
2014-07-26 01:47:46
阅读次数:
248
#include #include int main(){ int n; scanf("%d", &n); char s[100]; while(n--) { scanf("%s", s); int len = strlen(s); ...
分类:
其他好文 时间:
2014-07-26 01:47:36
阅读次数:
147
#include #include #include using namespace std;int main(){ char s[100]; int i,j,n,ans; cin>>n; getchar(); while (n>0) { n--; ...
分类:
其他好文 时间:
2014-07-26 01:46:56
阅读次数:
221