Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int x,h,m;
- void goback(){
- if(m==0 & h==0){
- h=23;
- m=59;}
- else if(m==0){
- h--;
- m=59;
- }
- else
- m--;
- }
- bool check(int m,int h){
- bool test = false;
- int c;
- while(m!=0){
- c = m % 10;
- m = m / 10;
- if(c==7){
- return true;
- break;
- }
- }
- while(h!=0){
- c = h % 10;
- h = h / 10;
- if(c==7){
- return true;
- break;
- }
- }
- return test;
- }
- int main(){
- cin>>x;
- cin>>h;
- cin>>m;
- int total=0;
- while(check(m,h)==false){
- goback();
- total++;
- }
- int y = total/x;
- cout<<y;;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement