真心求解!浙大ZOJ平台上3168题,觉得很简单啊,但一直WA.坐等哭求大牛!Sort ZOJ7--------------------------------------------------------------------------------Time Limit: 1 Second Memory Limit: 32768 KB -----------------------
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/30 07:00:07
![真心求解!浙大ZOJ平台上3168题,觉得很简单啊,但一直WA.坐等哭求大牛!Sort ZOJ7--------------------------------------------------------------------------------Time Limit: 1 Second Memory Limit: 32768 KB -----------------------](/uploads/image/z/14296548-12-8.jpg?t=%E7%9C%9F%E5%BF%83%E6%B1%82%E8%A7%A3%21%E6%B5%99%E5%A4%A7ZOJ%E5%B9%B3%E5%8F%B0%E4%B8%8A3168%E9%A2%98%2C%E8%A7%89%E5%BE%97%E5%BE%88%E7%AE%80%E5%8D%95%E5%95%8A%2C%E4%BD%86%E4%B8%80%E7%9B%B4WA.%E5%9D%90%E7%AD%89%E5%93%AD%E6%B1%82%E5%A4%A7%E7%89%9B%21Sort+ZOJ7--------------------------------------------------------------------------------Time+Limit%3A+1+Second++++++Memory+Limit%3A+32768+KB+-----------------------)
真心求解!浙大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
这是一个神话题目,哥哥,看不懂...我把这个神话交你了哈,