Codeforces A - Romaji 1008A
A solution in c++
#include<bits/stdc++.h>
using namespace std;
/// Typedef
typedef long long int ll;
//Int data type
#define sc1(a) scanf("%d", &a)
#define sc2(a, b) scanf("%d %d", &a, &b)
#define sc3(a, b, c) scanf("%d %d %d", &a, &b, &c)
#define sc4(a, b, c, d) scanf("%d %d %d %d", &a, &b, &c, &d)
//Long Data type
#define scl1(a) scanf("%lld", &a)
#define scl2(a, b) scanf("%lld %lld", &a, &b)
#define scl3(a, b, c) scanf("%lld %lld %lld", &a, &b, &c)
#define scl4(a, b, c, d) scanf("%lld %lld %lld %lld", &a, &b, &c, &d)
#define mx 1000005
#define pf(a) cout<<a<<endl
/************ Star Library ************/
// Square number count in 2 number range (3 - 10)--> 2
#define Square_number_count_in_2_rang(n) for(ll i=0; i<n; i++){ scl2(a,b); ck = sqrt(a-1); dk = sqrt(b); cout<<dk-ck<<endl; }
// ********* Start in main method code ************//
ll max(ll a, ll b){ return (a>b) ? a : b; }
ll arr[mx],brr[mx],crr[mx];
int main()
{
ll a,n,b,i,j,dk,ck=0;
string arr;
cin>>arr;
for(i = 0; i < arr.length(); i++){
if(arr[i] == 'a' || arr[i] == 'e' || arr[i] == 'i' || arr[i] == 'o' || arr[i] == 'u' || arr[i] == 'n'){
continue;
}
else{
if(arr[i + 1] == 'a' || arr[i + 1] == 'e' || arr[i + 1] == 'i' || arr[i + 1] == 'o' || arr[i + 1] == 'u')
continue;
else
return cout << "NO" << endl, 0;
}
}
cout << "YES" << endl;
}
0 Comments
If you have any doubts, Please let me know