A - Append s Editorial by en_translator
If you are new to learning programming and do not know where to start, please try Problem A “Welcome to AtCoder” from practice contest. There you can find a sample code for each language.
Also, if you are not familiar with problems in programming contests, we recommend you to try some problems in “AtCoder Beginners Selection” (https://atcoder.jp/contests/abs).
This problem can be solved by receiving a string form the input, appending s, and printing the resulting string.
Different languages have different ways to receive input, appending a character to a string, and printing output. Below is sample code in C++, Python 3, and Java.
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
s += 's';
cout << s << endl;
return 0;
}
s = input()
s += 's'
print(s)
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
s += "s";
System.out.println(s);
}
}
posted:
last update: