ソースコード
//============================================================================
// Name : hello.cpp
// Author : SHIN
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
for(int i = 1; i<N+1; i++){
int amari = i % 3;
if (amari == 0){
cout << i << "!" << endl;
}
else{
cout << i << endl;
}
}
return 0;
}