Official

A - Weather Forecast 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.


This problem asks to output the string corresponding to the \(N\)-th character of \(S\).

Note that in many programming languages, the index of arrays or strings are \(0\)-indexed, so when you want the \((N-1)\)-th character, you have to specify \(N-1\) as the index.

Sample code (C)

#include<stdio.h>
int main(){
	int n;
	char s[8];
	scanf("%d %s",&n,s);
	if(s[n-1]=='o')puts("Yes");
	else puts("No");
}

Sample code (Python)

N = int(input())
S = input()
if S[N-1]=="o":
	print("Yes")
else:
	print("No")

posted:
last update: