fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. char arr[5] = { 'a', 'b', 'c', 'd', 'e' };
  5. for(int i = 1; i < 5; i++) {
  6. cout << "*";
  7. if((arr[i] - arr[i - 1]) % 2)
  8. continue;
  9. cout << "*";
  10. }
  11. return 0;
  12. }
  13.  
  14.  
Success #stdin #stdout 0s 5296KB
stdin
Standard input is empty
stdout
****