I'm 100% sure from testing that for loop does iterate through characters how is it suposed to, but the other part of the program isn't working correctly. Im trying with if statement to print only uppercase characters.
Here are some input/output samples to get a better pitcure what this program is about:
Input: Tim-Berners-Lee
Output: TBL
Input: Albert-Einstein
Output: AE
Here is the code:
#include <iostream>
#include <string>
using namespace std;
int main(){
string name;
cin >> name;
int N = name.length();
for (int i = 0; i < N; i++)
{
if (name[i] == 'A' || 'B' || 'C' || 'D' || 'E' || 'F' || 'G' || 'H' || 'I' || 'J' || 'K' || 'L' || 'M' || 'N' || 'O' || 'P' || 'Q' || 'R' || 'S' || 'T' || 'U' || 'V' || 'W' || 'X' || 'Y' || 'Z'){
cout << name[i];
}
}
}