Posts

Showing posts from December, 2018

Timus Online Judge Solution

Image
Coming Soon...............................

Codeforces Solution 82A Double Cola

Image
#include <iostream> using namespace std ; int main () { int n , c = 0 ; cin >> n ; while ( n > 5 ) { n = n / 2 ; n -= 2 ; } if ( n == 1 ) cout << "Sheldon" << endl ; else if ( n == 2 ) cout << "Leonard" << endl ; else if ( n == 3 ) cout << "Penny" << endl ; else if ( n == 4 ) cout << "Rajesh" << endl ; else if ( n == 5 ) cout << "Howard" << endl ; return 0 ; }

Codeforces Solution 501A Contest

Image
#include <iostream> #include <algorithm> using namespace std ; int main () { long long int a , b , c , d , ma , mb ; cin >> a >> b >> c >> d ; ma = max ((( 3 * a )/ 10 ), a -(( a / 250 )* c )); mb = max ((( 3 * b )/ 10 ), b -(( b / 250 )* d )); if ( ma == mb ) cout << "Tie" << endl ; else if ( ma > mb ) cout << "Misha" << endl ; else cout << "Vasya" << endl ; return 0 ; }

library Management System

Image
#include<bits/stdc++.h> #include<windows.h> using namespace std; int com,l,temp,te,t=0,f,k=0,p,day,month,year,day1,month1,year1,fi,gi,v,go=0,in=0,li[100]; string ch; ofstream outl; class book { protected:     int id_book[1000],number_of_books[1000],d;     string book_name[1000],author_name[1000]; public:     void updatebook()     {         ofstream outfile;         outfile.open("input00.dat",ios::app);         outl.open("input5.dat");         cout<<"How Many Book You Want To Entry:"<<endl;         cin>>d;         for(int i=1; i<=d; i++)         {             cout<<"Enter book id number: ";             cin>>id_book[i];             cin.ignore();             outfile<<id_book[i]<<endl;             cout<<"Enter Books name: ";             cin>>book_name[i];             cin.ignore();             outfile<<book_name[i]<<endl;