ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

pritf; scanf; c++ (visual studio)
Posted by nightmare1296 29 Mar 2016 20:57
Please, help me understand, how turn on printf and scanf in my program.
If I write :
int Solution (int n, int a, int b)
{
    return (2*n*a*b);
}

int main()
{
    int n,a,b;
    scanf ("%d %d %d", &n, &a, &b);
    printf ("%d", Solution (n,a,b));
    return 0;
}

system will throw "Compilation error" with
vtje2d-4h6iqg.cpp(9) : error C3861: 'scanf': identifier not found
vtje2d-4h6iqg.cpp(10) : error C3861: 'printf': identifier not found.

If i write the same, with #include "stdafx.h" on the top, system will throw "Compilation error" with
rvkkio-7db2pu.cpp(4) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
Re: pritf; scanf; c++ (visual studio)
Posted by Денис Без*у*в 30 Mar 2016 12:43
#include <cstdio>

Edited by author 30.03.2016 12:44