scanf("%d",&amount);
You want to scan in as a float, not an integer, so you’ll want %f
More Related Contents:
- Why the values {1, 1, 0, -1, -1, -1, 0, 1} and {0, 1, 1, 1, 0, -1, -1, -1} were chosen for dx[dir] and dy[dir]? [closed]
- What XML parser should I use in C++? [closed]
- AVX2 what is the most efficient way to pack left based on a mask?
- How to convert vector to array
- Is it better to use std::memcpy() or std::copy() in terms to performance?
- Dual emission of constructor symbols
- What is constructor inheritance?
- Why function template cannot be partially specialized?
- How do I get the index of an iterator of an std::vector?
- How to use std::sort to sort an array in C++
- when g++ static link pthread, cause Segmentation fault, why?
- Why an unnamed namespace is a “superior” alternative to static? [duplicate]
- C++, Sort One Vector Based On Another One [duplicate]
- Range-based for loop on a dynamic array?
- Converting cv::Mat to IplImage*
- How to print __int128 in g++?
- Can I obtain C++ type names in a constexpr way?
- Qt Creator – Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild
- How do I store arrays in an STL list?
- Why is allocator::rebind necessary when we have template template parameters?
- Use CreateProcess to Run a Batch File
- std::remove_if – lambda, not removing anything from the collection
- Undefined reference C++
- gcc can compile a variadic template while clang cannot
- std::ofstream, check if file exists before writing
- Calling delete on NULL pointers – C++03 vs C++11
- Passing reference to STL vector over dll boundary
- Is there a way to write make_unique() in VS2012?
- What is the difference between a template class and a class template?
- Scope resolution operator being used twice