102910: [Atcoder]ABC291 A - camel Case
Description
Score : $100$ points
Problem Statement
You are given a string $S$ consisting of uppercase and lowercase English letters.
Here, exactly one character of $S$ is uppercase, and the others are all lowercase.
Find the integer $x$ such that the $x$-th character of $S$ is uppercase.
Here, the initial character of $S$ is considered the $1$-st one.
Constraints
- $S$ is a string of length between $2$ and $100$, inclusive, consisting of uppercase and lowercase English letters.
- $S$ has exactly one uppercase letter.
Input
The input is given from Standard Input in the following format:
$S$
Output
Print the integer $x$ such that the $x$-th character of $S$ is uppercase.
Sample Input 1
aBc
Sample Output 1
2
The $1$-st character of aBc
is a
, the $2$-nd is B
, and the $3$-rd is c
;
the $2$-nd character is uppercase.
Thus, $2$ should be printed.
Sample Input 2
xxxxxxXxxx
Sample Output 2
7
An uppercase letter X
occurs as the $7$-th character of $S=$xxxxxxXxxx
, so $7$ should be printed.
Sample Input 3
Zz
Sample Output 3
1
Input
题意翻译
给定一个字符串 $s$,$s$ 中包含且只有一个大写字母,找出这个大写字母的位置并输出。Output
问题描述
给你一个由大写和小写英文字母组成的字符串$S$。
其中,$S$中的恰好一个字符是大写,其他字符都是小写。
找到一个整数$x$,使得$S$中的第$x$个字符是大写。
这里,$S$的第一个字符被认为是第$1$个。
限制条件
- $S$是一个长度在$2$到$100$之间的字符串,由大写和小写英文字母组成。
- $S$恰好有一个大写字母。
输入
输入将从标准输入中给出,格式如下:
$S$
输出
打印一个整数$x$,使得$S$中的第$x$个字符是大写。
样例输入1
aBc
样例输出1
2
aBc
的第一个字符是a
,第二个字符是B
,第三个字符是c
;
第二个字符是大写。
因此,应该打印$2$。
样例输入2
xxxxxxXxxx
样例输出2
7
一个大写字母X
作为$S=$xxxxxxXxxx
的第$7$个字符出现,所以应该打印$7$。
样例输入3
Zz
样例输出3
1