Informatik 12 Zgjidhja f2
-
Upload
ilirian-rexho -
Category
Documents
-
view
214 -
download
0
Transcript of Informatik 12 Zgjidhja f2
-
8/18/2019 Informatik 12 Zgjidhja f2
1/7
1
AGJENCIA KOMBËTARE E PROVIMEVE
Olimpiada Kombëtare e Informatië! "a#a II
Viti !$ollor %&'()%&'* Kla!a +II
Totali
', Ndërtoni n-ë pro.ram/ 0ë d1e përdor1r 2ilet/ të !$fa0ë me !imbolin 3*3 fi.1rën emëpo!$tme, '& pië
Shembull: Inputi:
7
Outputi:
Zgjidhja:
#include #include int main ()
{
****
*********************
int a,b,c,n,baza;
printf ("Jepni diagonalen ( n )!n");
scanf ("d",n);
baza $ (n%&)';
for (a$; a
-
8/18/2019 Informatik 12 Zgjidhja f2
2/7
2. Ndërtoni n-ë pro.ram 0ë .-en n1mrin më të 4o.ël prim palindromë 0ë .-endet në!e.mentin N 5 '&&&&&&/ 1 N merret !i inp1t6'5N7,
Një numër konsiderohet palindromë nëse lexohet njëlloj nga të dyja anët.
Për shembull, 58185 dhe 64646 janë palindroma.
Një numër është prim nëse plotpjesëtohet etëm me eten dhe me
1 Për shembull numri !".
Zgjidhja :Shembull: Inputi: 7
Outputi : 11
#include
#include
#include #define -/0
int main()
{
'* pië
long n, t, r $ , c, d;
printf("Jepni n1e numer!n");
scanf("ld", n); %+
-
8/18/2019 Informatik 12 Zgjidhja f2
3/7
8, Jepet matri2a A9M:9M:,Tre.oni në!e emi të bë-më me n-ë atror ma.-io!e -o,
'& pië
Shembull : Inputi 4 9 2
3 5 7
8 1 6
Outputi Katror magji Zgjidhja:#include#include
int main() {
int 9,:,:,:&,flag$,i,1;
printf ("Jepni 9 ");
scanf ("d",9);
int 9=9=; %% :hembull ==$ {{?,@,&,{,A,B,{C,,D;
printf("!nJepni elementet e matrices ");
for (i $ ; i < 9; i'') {
for(1 $ ; 1 < 9; 1'')
scanf("d", i=1=);
printf("9atrica e futur pre1 1ush eshte !n");
for (i $ ; i < 9; i'') {
printf("!n");
for(1 $ ; 1 < 9; 1'') {
printf("!td", i=1=);
%%Eer elementet ne diagonale
: $ ;
for(i $ ; i < 9; i'') {
for (1 $ ; 1 < 9; 1'') {
if (i $$ 1)
: $ : ' i=1=;
%%Eer rreshtat
for(i $ ; i < 9; i'') {
: $ ;
for(1 $ ; 1 < 9; 1'') {
: $ : ' i=1=;
if (: $$ :)
flag $ ;
else {
flag $ ;
brea8;
%%Eer rreshtat
for(i $ ; i < 9; i'') {
:& $ ;
for(1 $ ; 1 < 9; 1'') {
:& $ :& ' i=1=;
if (: $$ :&)
flag $ ;
else {
flag $ ;
brea8;
if (flag $$ )
printf("!n7atror mag1i8.");else
printf("!n5u8 eshte 8atror mag1i8.");
getch();
-
8/18/2019 Informatik 12 Zgjidhja f2
4/7
Zona 1
Zona 2
Zona 3
Link
4. Ndërtoni fa0en ;eb !i në fi.1rë<
Faqja ndahet në tre zona:Zona 1 dhe Zona 2 (ku ndodhen menutë dhe një uton kërkimi! janë men"j#rë të "je$ër
%ë Zonën 3 keni të &ër'shirë një imazh një tekst dhe një $ink që ju )on te'aqja in'ormatikëhtm$
'& pië
Flimpiada e Gnformati8Hs I &A
.st2le
{ tet*align right;
.st2le&
{ color #;
Flimpiada &A
9atemati8H
Gnformati8H
Nizi8H
7imi
B.&.&A
:ot do tH zhOillohet Flimpiada 7ombHtare e
Gnformati8Hs, Naza GG.
7li8oni per me teper -
8/18/2019 Informatik 12 Zgjidhja f2
5/7
-
8/18/2019 Informatik 12 Zgjidhja f2
6/7
5. Tre.oni =farë afi!$o$et në eran n.a odi i mëpo!$tëm<
Oar f $ document.create0lement("form");
f.setttribute(KmethodK,"post");
f.setttribute(KactionK,"submit.php");
document.3rite("0mri");
Oar i $ document.create0lement("input"); %% tet
i.setttribute(Kt2peK,"tet");
i.setttribute(KnameK,"emri");
document.3rite("N1alH8alimi");
Oar 1 $ document.create0lement("input"); %% tet
1.setttribute(Kt2peK,"tet");
1.setttribute(KnameK,"f1ale8alimi");
Oar s $ document.create0lement("input"); %% buton :ubmit
s.setttribute(Kt2peK,"submit");
s.setttribute(KOalueK,":ubmit");
f.appendLhild(i);
f.appendLhild(1);
f.appendLhild(s);
document.get0lementsP2-ag5ame(Kbod2K)
-
8/18/2019 Informatik 12 Zgjidhja f2
7/7
Zgjidhja :