ACM PKU 1002题总是WA各种测试数据都试过了 没有发现问题 可是C++提交上去 又是WA#include #include #include #include using namespace::std;string directory[100];string result[100];int len = 0;int resLen = 0;int isaTel(string &tel

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/05 22:46:00
ACMPKU1002题总是WA各种测试数据都试过了没有发现问题可是C++提交上去又是WA#include#include#include#includeusingnamespace::std;stri

ACM PKU 1002题总是WA各种测试数据都试过了 没有发现问题 可是C++提交上去 又是WA#include #include #include #include using namespace::std;string directory[100];string result[100];int len = 0;int resLen = 0;int isaTel(string &tel
ACM PKU 1002题总是WA
各种测试数据都试过了 没有发现问题 可是C++提交上去 又是WA
#include
#include
#include
#include
using namespace::std;
string directory[100];
string result[100];
int len = 0;
int resLen = 0;
int isaTel(string &tel)
{
string::iterator pos = tel.begin();
while (pos = tel.end())
{
if ((*pos) == '-')
{
tel.erase(pos);
}
else
{
pos++;
}
}
if (tel.size() = 7)
{
return 0;
}
for (pos = tel.begin(); pos = tel.end(); pos++)
{
if isalnum(*pos))
{
return 0;
}
else
{
if (islower(*pos))
{
return 0;
}
else
{
if (*pos == 'Q' || *pos == 'Z')
{
return 0;
}
}
}
}
pos = tel.begin() + 3;
tel.insert(pos,'-');
tel += " 1";
return 1;
}
void transfer(string &tel)
{
for (int i = 0; i < 8; i++)
{
switch (tel[i])
{
case 'A':
tel[i] = '2';
break;
case 'B':
tel[i] = '2';
break;
case 'C':
tel[i] = '2';
break;
case 'D':
tel[i] = '3';
break;
case 'E':
tel[i] = '3';
break;
case 'F':
tel[i] = '3';
break;
case 'G':
tel[i] = '4';
break;
case 'H':
tel[i] = '4';
break;
case 'I':
tel[i] = '4';
break;
case 'J':
tel[i] = '5';
break;
case 'K':
tel[i] = '5';
break;
case 'L':
tel[i] = '5';
break;
case 'M':
tel[i] = '6';
break;
case 'N':
tel[i] = '6';
break;
case 'O':
tel[i] = '6';
break;
case 'P':
tel[i] = '7';
break;
case 'R':
tel[i] = '7';
break;
case 'S':
tel[i] = '7';
break;
case 'T':
tel[i] = '8';
break;
case 'U':
tel[i] = '8';
break;
case 'V':
tel[i] = '8';
break;
case 'W':
tel[i] = '9';
break;
case 'X':
tel[i] = '9';
break;
case 'Y':
tel[i] = '9';
break;
default:
break;
}
}
}
int stringCpy(const string &str1,const string &str2)
{
for (int i = 0; i < 8; i++)
{
if (str2[i] = str1[i])
{
return 0;
}
}
return 1;
}
void Add(const string &tel)
{
bool exits = false;
int i;
for (i = 0; i < len; i++)
{
if (stringCpy(tel,directory[i]))
{
directory[i][9]++;
exits = true;
break;
}
}
if exits)
{
directory[i] = tel;
len++;
}
}
void fastDivid()
{
for (int i = 0; i < len; i++)
{
if (directory[i][9] > '1')
{
result[resLen] = directory[i];
resLen++;
}
}
}
}
int main()
{
int num_tels;
string telnum;
cin >> num_tels;
for (int i = 0; i < num_tels; i++)
{
cin >> telnum;
if (isaTel(telnum))
{
transfer(telnum);
Add(telnum);
}
}
fastDivid();
sort(result,result + resLen);
for (int j = 0; j < resLen; j++)
{
for (int k = 0; k < 9; k++)
{
cout

ACM PKU 1002题总是WA各种测试数据都试过了 没有发现问题 可是C++提交上去 又是WA#include #include #include #include using namespace::std;string directory[100];string result[100];int len = 0;int resLen = 0;int isaTel(string &tel
北大poj的1002,送上我丑陋的代码,夜深了,困了,睡觉去了,要是lz
有疑惑,给我留言吧!
(我是看的北大郭伟和李文新出的那本小红书上面的方法做的)
#include
using namespace std;
char realnumble[100000][9];
char arr[50];
char map[]={"22233344455566677778889999"};
void fun(int n)
{
int j=0,k=0;
j=-1;
k=-1;
while(k='A'&&arr[j]

ACM PKU 1002题总是WA各种测试数据都试过了 没有发现问题 可是C++提交上去 又是WA#include #include #include #include using namespace::std;string directory[100];string result[100];int len = 0;int resLen = 0;int isaTel(string &tel pku ACM题翻译在哪找? 关于PKU上的1007题,为什么总是WA按照题目给定的输入可以输出题目要求的,不过提交总是WA,请大牛们不吝赐教~我的代码如下:#include#include#includeusing namespace std; int main(){int i,j,z,n,m;int num1[100],nu acm pku 2062题wa,#include#includeusing namespace std;int n,m,i,j,score;char adam[26][2],eve[26][2],doing;int a[26],e[26];void tonum(){for(i=0;i>n;doing=0;while(n--){cin>>m;score=0;for(i=0;i>adam[i];}for(i=0;i>eve[i];}tonum();sort(a,a+m);sort(e,e+m); 北大ACM 1993题!快要交了..实在做不出来..有没有哪位能帮忙下...谢谢啦!程序正确追加100分!绝对!题目:http://acm.pku.edu.cn/JudgeOnline/problem?id=1993 做acm看到的ac、wa是什么的缩写? ACM水题老是WA,求解救美丽的数 Time Limit:1000MS Memory Limit:32768KDescription:有些数总是与众不同,它们认为自己比其它数美丽.数与数之间是怎样比美丽的呢?它们往往看谁拥有的质数数字多!例如333只 PKU是什么 acm pku 1001while(s[l]!=(int)s[l]){s[l]*=10;i++;}sx=(int)s[l]; for(int r=1;r c语言acm题 acm刷题是什么意思 高手来帮我把这道acm的水题的我的代码找下错试过很多组数据 也都是正确的 可是提交的时候就是显示WA了 www.pku.edu. Pku是什么病 什么是LSE PKU 一道杭电ACM的测试题,我运行的没问题,但是提交却是WA,Problem DescriptionJack and Jill have decided to sell some of their Compact Discs,while they still have some value.They have decided to sell one of each of the CD titles that they 一道ACM题,为什么WA了,Nowadays,a kind of chess game called “Super Jumping!Jumping!Jumping!” is very popular in HDU.Maybe you are a good boy,and know little about this game,so I introduce it to you now.The game can be played by two or more t ACM的一道题,看着很简单,提交却WA了,More than FibonacciTime Limit:1000msMemory Limit:65536kbDescriptionThe New Fibonacci numbers (0,1,2,3,6,11,20,37,68,...) are defined by the recurrence:F(0) = 0; F(1) = 1; F(2) = 2; F(n) = F(n-1) + F(n-2)