Quick actions

cmd+k|ctrl+k

Navigation

Languages

Task №149 

Snippet info

Language

Cpp

Visibility

public

Author

diety

Created

2018-11-18T18:32:31Z

Updated

2018-11-18T18:32:31Z

#include <stdio.h>
#include <stdlib.h>
 
#define taller  1770
#define horse   31
#define bull    27
 
int main()
{
    int i = 0, count = 0;
    while ( (horse * i) <= taller )
        if ( !((taller - horse * i++) % bull) )
            printf("\n%i horses and %i bulls count = %i", i - 1, (taller - horse * (i - 1)) / bull, ++count);
    puts("\n");
    return 0;
}
INFO