真心求解!浙大ZOJ平台上3168题,觉得很简单啊,但一直WA.坐等哭求大牛!Sort ZOJ7--------------------------------------------------------------------------------Time Limit: 1 Second Memory Limit: 32768 KB -----------------------
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 02:26:39
真心求解!浙大ZOJ平台上3168题,觉得很简单啊,但一直WA.坐等哭求大牛!Sort ZOJ7--------------------------------------------------------------------------------Time Limit: 1 Second Memory Limit: 32768 KB -----------------------
真心求解!浙大ZOJ平台上3168题,觉得很简单啊,但一直WA.坐等哭求大牛!
Sort ZOJ7
--------------------------------------------------------------------------------
Time Limit: 1 Second Memory Limit: 32768 KB
--------------------------------------------------------------------------------
Given a string of no more than 1000 characters. You are supposed to sort the characters into a substring of all Z's followed by O's, J's, 7's, and the rest of the other characters.
Input
Each case gives a string described by the problem. The string given contains no space.
Output
For each test case, output the resulting string. Note the order of the characters other than Z, O, J and 7 must be kept after sorting.
Sample Input
t7ZJ7OhO7B7O7irZtOhZdayJ77
Sample Output
ZZZOOOOJJ7777777thBirthday
我的代码:
#include
#include
using namespace std;
int main(void)
{
int i,z=0,o=0,j=0,q=0,c=0;
char ss[1000]={0};
char buff[1000]={0};
cin>>ss;
for(i=0;i
真心求解!浙大ZOJ平台上3168题,觉得很简单啊,但一直WA.坐等哭求大牛!Sort ZOJ7--------------------------------------------------------------------------------Time Limit: 1 Second Memory Limit: 32768 KB -----------------------
注意多组测试数据!
#include
#include
using namespace std;
int main()
{
char ss[1000]={0};
char buff[1000]={0};
while(cin>>ss)
{
int z=0,o=0,j=0,q=0,c=0;
for(int i=0;i
这是一个神话题目,哥哥,看不懂...我把这个神话交你了哈,