#include <iostream> #include <stdio.h> using namespace std;
int main(){ int y; cin>>y; y=y%12; switch (y){ case 4:{cout<<"Mouse"; break;} case 5:{cout<<"Bull";break;} case 6:{cout<<"Tiger";break;} case 7:{cout<<"Rabbit";break;} case 8:{cout<<"Dragon";break;} case 9:{cout<<"Snake";break;} case 10:{cout<<"Horse";break;} case 11:{cout<<"Goat";break;} case 0:{cout<<"Monkey";break;} case 1:{cout<<"Cock";break;} case 2:{cout<<"Dog";break;} case 3:{cout<<"Pig";break;} } cin.get(); cin.get(); return 0; }
Richbro7
22.02.2020
1. var s: string; i, count: integer; begin writeln('Vvedite stroky: '); readln(s); for i := 1 to length(s) - 2 do if copy(s, i, 3) = 'abc' then count := count + 1; writeln('Kol-vo: ', count); end. 2. var s1, s2: string; i, len1, len2: integer; begin writeln('Vvedite stroky 1: '); readln(s1); writeln('Vvedite stroky 2: '); readln(s2); len1 := length(s1); len2 := length(s2); if len1 > len2 then writeln('1 stroka dlinnee') else if len1 < len2 then writeln('2 stroka dlinnee') else writeln('dlini strok ravnie') end. 3. var s1, s2, s3: string; begin writeln('Vvedite stroky 1: '); readln(s1); writeln('Vvedite stroky 2: '); readln(s2); s3 := s1[1] + s1[2] + s2[1] + s2[2]; writeln('Novaja stroka: ', s3); end.
#include <stdio.h>
using namespace std;
int main(){
int y;
cin>>y;
y=y%12;
switch (y){
case 4:{cout<<"Mouse"; break;}
case 5:{cout<<"Bull";break;}
case 6:{cout<<"Tiger";break;}
case 7:{cout<<"Rabbit";break;}
case 8:{cout<<"Dragon";break;}
case 9:{cout<<"Snake";break;}
case 10:{cout<<"Horse";break;}
case 11:{cout<<"Goat";break;}
case 0:{cout<<"Monkey";break;}
case 1:{cout<<"Cock";break;}
case 2:{cout<<"Dog";break;}
case 3:{cout<<"Pig";break;}
}
cin.get();
cin.get();
return 0;
}