CSES - Datatähti 2022 alku - Results
Submission details
Task:Karkit (Candy)
Sender:Parodontax
Submission time:2021-10-04 12:42:48
Language:C++11
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:7:14: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' and 'int')
     cin >> n << a << b;
     ~~~~~~~~~^~~~
input/code.cpp:7:14: note: candidate: operator<<(int, int) <built-in>
input/code.cpp:7:14: note:   no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' to 'int'
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from input/code.cpp:1:
/usr/include/c++/7/bits/basic_string.h:6284:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std

Code

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
    int n, a, b, x;
    cin >> n << a << b;
    if (a < b)
    {
        x = floor(a / n);
    }
    else
    {
        x = floor(a / b);
    }
    cout << x << "\n";
}