输出样例: GPLTGPLTGLTGLGLL 我也不知道这么写有没有问题,但是确实简单的解决了问题。 那就直接统计个数,然后按照顺序一个一个的排队输出,没有了的当然也就停止不在输出了。 //#include<bits/stdc++.h>#include <iostream>#include<cstring>#include<string>#include<iomanip>//格式化输入输出
#include<cstring> using namespace std; const int maxn = 10010; int g,p,l,t; int main() { char c; while(~scanf("%c",&c) && c != '\n') { if(c == 'G' || c == 'g') g++; else if(c == 'P' || c == 'p') p++; else if(c == 'L' || c == 'l') l+...
输入样例: pcTclnGloRgLrtLhgljkLhGFauPewSKgt 结尾无空行 1. 2. 3. 输出样例: GPLTGPLTGLTGLGLL 结尾无空行 1. 2. 3. #include <bits/stdc++.h> usingnamespacestd; /* int a = 1,b = 2,c = 4;//0x0001,0x0010,0x0100 a |= b;// a = 0x0011 = 3 b |= c;// b = 0x0110 = ...
https://www.patest.cn/contests/gplt/L1-023 AC代码 #include<iostream>#include<cstdio>#include<algorithm>#include<cmath>#include<deque>#include<vector>#include<queue>#include<string>#include<cstring>#include#include<stack>#include<set>#include<cstdlib>#include<ctype.h>#include<numeric>#include<ss...
输出样例: GPLTGPLTGLTGLGLL 代码 #include<iostream>#include<string>using namespace std;int main(){string s = "";cin >> s;int n = 0;int number[4];char result[4] = { 'G','P','L','T' };for (int i = 0; i < 4; i++){number[i] = 0;}char c;c = s[0];while (c...
输出样例: GPLTGPLTGLTGLGLL 代码 #include<iostream> #include<string> using namespace std; int main() { string s = ""; cin >> s; int n = 0; int number[4]; char result[4] = { 'G','P','L','T' }; for (int i = 0; i < 4; i++) { number[i] = 0; } char c; ...
L1-023 输出GPLT (20 分) L1-023 输出GPLT (20 分) 给定一个长度不超过10000的、仅由英文字母构成的字符串。请将字符重新调整顺序,按GPLTGPLT...这样的顺序输出,并忽略其它字符。当然,四种字符(不区分大小写)的个数不一定是一样多的,若某种字符已经输出完,则余下的字符仍按GPLT的顺序打印,直到所有字符都被...
【题解】【PTA团体程序设计天梯赛】L1-023 输出GPLT (20 分) Go语言 | Golang L1-023 输出GPLT (20 分) Go语言|Golang 给定一个长度不超过10000的、仅由英文字母构成的字符串。请将字符重新调整顺序,按GPLTGPLT...这样的顺序输出,并忽略其它字符。当然,四种字符(不区分大小写)的个数不一定是一样多的,...
PTA L1-023 输出GPLT C语言版 给定一个长度不超过10000的、仅由英文字母构成的字符串。请将字符重新调整顺序,按GPLTGPLT...这样的顺序输出,并忽略其它字符。当然,四种字符(不区分大小写)的个数不一定是一样多的,若某种字符已经输出完,则余下的字符仍按GPLT的顺序打印,直到所有字符都被输出。 输入格式: 输入...
输出GPLT(20分)(C语言) 给定一个长度不超过10000的、仅由英文字母构成的字符串。请将字符重新调整顺序,按GPLTGPLT...这样的顺序输出,并忽略其它字符。当然,四种字符(不区分大小写)的个数不一定是一样多的,若某种字符已经输出完,则余下的字符仍按GPLT的顺序打印,直到所有字符都被输出。 输入格式: 输入在一行...