The Numbers

2.8

15 votes
Very-Easy
Problem

Print the first 20 natural numbers in ascending order, where each of them is present in a new line.

This code will be used to calculate your marks. This is for your information only.
Checker Code:

#include <bits/stdc++.h>
using namespace std;
int main()
{
    double count=0;
    double expectedCodeSize=31;
    double maxAllowedSize = 40;
    double maxMarks = 100;
    char ch;
    while (scanf("%c",&ch)!=EOF)
        count++;    
    double score = 0.0;
    if (count <= expectedCodeSize)
        score = 100;
    else
    {
        maxAllowedSize /= 2;
        score = maxMarks * exp(-1*pow(((count-expectedCodeSize)/maxAllowedSize),2)/2);
    }
    cout<<score;    
    return 0;
}
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?