uses crt; var i,j,k,n,sum:integer; a:array[1..100] of integer; flag:boolean; begin flag:=false; writeln('Input N'); read(n); writeln('Input elements'); for i:=1 to n do read(a[i]); for i:=1 to n do for j:=1 to n do for k:=1 to n do if (i<>j) and (j<>k) and (i<>k) then if a[i]+a[j]+a[k]=0 then begin writeln('Yes'); flag:=true; halt; end; if flag=false then writeln('No'); end.
#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; }
var i,j,k,n,sum:integer;
a:array[1..100] of integer;
flag:boolean;
begin
flag:=false;
writeln('Input N');
read(n);
writeln('Input elements');
for i:=1 to n do
read(a[i]);
for i:=1 to n do
for j:=1 to n do
for k:=1 to n do
if (i<>j) and (j<>k) and (i<>k) then
if a[i]+a[j]+a[k]=0 then
begin
writeln('Yes');
flag:=true;
halt;
end;
if flag=false then
writeln('No');
end.