Thursday, February 5, 2015

Solution of 148A. Insomnia cure(Codeforces)

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define sf scanf
#define pf printf
typedef long long ll;

int main()
{
    int k, l, m, n, d;
    cin >> k >> l >> m >> n >> d;
    int count = 0;
    for(int i=1; i<=d; i++)
    {
        if(i%k==0 || i%l ==0 || i%m ==0 || i%n ==0)
        {
            count++;
        }
    }
    cout << count << endl;
}

2 comments:

Compare equality of two string in C

#include <stdio.h> #include<string.h> int main() {     char* country = "Bangladesh";     char* country2;     ...