Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int kr7=-1;
- int nekr7=-1;
- int k=0;
- while(1){
- int a;
- cin>>a;
- if(a==0){
- break;
- }
- k++;
- if(a%7!=0){
- nekr7=max(nekr7, a);
- }
- else{
- if(a%49!=0){
- kr7=max(kr7, a);
- }
- }
- }
- int ans;
- if(kr7==-1 || nekr7==-1){
- ans=1;
- }
- else{
- ans=kr7*nekr7;
- }
- int contr;
- cin>>contr;
- cout<<"Введено чисел: "<<k<<'\n';
- cout<<"Контрольное значение: "<<contr<<'\n';
- cout<<"Вычисленное значение: "<<ans<<'\n';
- if(contr==ans){
- cout<<"Значения совпали";
- }
- else{
- cout<<"Значения не совпали";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement