AtCoder ABC-151 A問題Next Alphabet

atcoder.jp

方針

アルファベットを順番に配列に格納。
入力した文字に対して走査し、i+1番目を出力します。

#include <stdio.h>
#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main()
{
  char a[27]="abcdefghijklmnopqrstuvwxyz";

  //char s[1];
  char s;
  scanf("%c", &s);

  for(int i=0; i<27; i++){
    if(a[i]==s){
      printf("%c\n", a[i+1]);
      return 0;
    }
  }

}