답안 #1035953

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1035953 2024-07-26T20:22:30 Z HienTD if-else 문 1 (BSC_0_8) C++14
100 / 100
0 ms 436 KB
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = (a), _b = (b); i <= _b; ++ i)
#define FORD(i, b, a) for(int i = (b), _a = (a); i >= _a; -- i)
#define REP(i, n) for(int i = 0, _n = (n); i < _n; ++ i)
#define FORE(i, v) for(__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i)
#define ALL(v) (v).begin(), (v).end()
#define IS_INF(x) (std::isinf(x))
#define IS_NAN(x) (std::isnan(x))
#define fi first
#define se second
#define MASK(i) (1LL << (i))
#define BIT(x, i) (((x) >> (i)) & 1)
#define div ___div
#define prev ___prev
#define left ___left
#define __builtin_popcount __builtin_popcountll
using namespace std;

template<class X, class Y>
    bool minimize(X &x, const Y &y){
        if(x > y){
            x = y;
            return true;
        } else return false;
    }
template<class X, class Y>
    bool maximize(X &x, const Y &y){
        if(x < y){
            x = y;
            return true;
        } else return false;
    }
template<class T>
    T abs(const T &x){
        return (x < 0 ? -x : x);
    }

/** END OF TEMPLATE **/

void init(){
    //
}

void process(){
    int a;
    scanf("%d", &a);
    if(a) printf("nonzero");
    else printf("zero");
}

int main(){
    init();
    process();

    return 0;
}

Compilation message

if1.cpp: In function 'void process()':
if1.cpp:46:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   46 |     scanf("%d", &a);
      |     ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 436 KB Output is correct
10 Correct 0 ms 348 KB Output is correct