Take a look at this C++ submission 199864568:
#import <bits/stdc++.h>
using namespace std;
int main()
{
int a;
cin >> a;
cout << ((a%2==0 && a>2) ? "YES" : "NO");
}
Don't see it?
Spoilers
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 160 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
I don't know how I've never seen this C++ feature before
Take a look at this C++ submission 199864568:
#import <bits/stdc++.h>
using namespace std;
int main()
{
int a;
cin >> a;
cout << ((a%2==0 && a>2) ? "YES" : "NO");
}
Take a closer look at the code =P
Look even closer.
Read the first line.
The first line uses #import
instead of the usual #include
.
The other day, I was coding some C++. My Pythonic muscle memory caused me to accedently write #import
instead of #include
, and to my great surprise, the code still compiled!
The only information that I was able to find about #import
is from this stackoverflow comment. As I understand it, #import
is a really old gcc feature that combines #include
and #prama once
into one.
There are arguably some other positives to using #import
instead of #include
. #import
is one character shorter than #include
, and as someone that mainly uses Python, it is easier for me to remember import than include.
Rev. | Язык | Кто | Когда | Δ | Комментарий | |
---|---|---|---|---|---|---|
en3 | pajenegod | 2023-03-31 17:31:44 | 1 | Tiny change: ' and `#prama once` i' -> ' and `#pragma once` i' | ||
en2 | pajenegod | 2023-03-30 23:21:38 | 20 | Tiny change: 'oser look =P\n\n<sp' -> 'oser look at the code =P\n\n<sp' | ||
en1 | pajenegod | 2023-03-30 23:20:17 | 1409 | Initial revision (published) |
Название |
---|