codeforces 118A (implementation, string) http://codeforces.com/problemset/problem/118/A 生词: vowel n.元音 consonant n.辅音 corresponding a.对应的 题面: 把一个字符串中的元音字母删除,辅音字母前加上一个‘.’,大写字母转换为小写字母。 使用头文件<cctype>处理。......
Vowels are letters "A", "O", "Y", "E", "U", "I", and the rest are consonants. The program's input is exactly one string, it should return the output as a single string, resulting after the program's processing the initial string. Help Petya cope with this easy task. The first...
codeforces 118A - String Task #include<stdio.h> #include<string.h> int main() { char a[120]; int i,len; gets(a); len = strlen(a); for(i=0;i<len;i++) { if(a[i]=='A'||a[i]=='a'||a[i]=='E'||a[i]=='e'||a[i]=='I'||a[i]=='i'||a[i]=='O'||a...
http://codeforces.com/problemset/problem/118/A #include<iostream> #include<string> #include<cctype> #include<algorithm> using namespace std; int main() { string str; cin>>str; int i; //将代码变成小写 transform(str.begin(), str.end(), str.begin(), ::tolower); //移除特定的字符串...
A. String Task http://codeforces.com/problemset/problem/118/A time limit per test memory limit per test input output Petya started to attend programming lessons. On the first lesson his task was to write a simple program. The program was supposed to do the following: in the given string,...
stringS;cin>>S;cout<<S; you will get just you as your output. To get the whole string as an input, use the following line: stringS;getline(cin,S);cout<<S; you get the whole line scanned in S. 2. tokenizing the scanned line ...
I wrote a trie-based solution to this problem, but I can't fit it into the memory limit (MLE 4/10 cases). If this helps anyone, they can look atmy code. →Reply sqrtdecompton 7 years ago,#^| +6 I changed my approach and finally got AC. I believe my solution is O(m log m...
There are multiple test cases. The first line of input is an integer T ≈ 10000 indicating the number of test cases. Each test case contains a nonempty string s and an integer 1 ≤ n ≤ 100. The string s consists of no more than 100 characters whose ASCII values range from 33(‘!’...
CodeForces Algorithms. Contribute to m-aprameya/CodeForces development by creating an account on GitHub.
Your task is to reorder the letters in the string s in such a way that the resulting string is a k-string. The first input line contains integer k (1 ≤ k ≤ 1000). The second line contains s, all characters in s are lowercase English letters. The string length s ...