kiem tien, kiem tien online, kiem tien truc tuyen, kiem tien tren mang
Thứ Sáu, 21 tháng 2, 2014

Đề bài:

Ví dụ: 7 3 5 9 6 8 17 11 13 15
Xuất: các dãy con tăng dần:
  dãy 1: 7
  dãy 2: 3 5 9
  dãy 3: 6 8 17
  dãy 4: 11 13 15

Video:



Mã lệnh:


#include <stdio.h>
#include <conio.h>


int
main(){
int
a[10]={7, 3, 5, 9, 6, 8, 17, 11, 13, 15};
int
n = 1;
for
(int i=0;i<9;){
int
t = a[i];
printf
("Day %d: %d ",n,t);
int
j;
for
(j=i+1;j<10;j++){
if
(t<=a[j])
{

t
=a[j];
printf
("%d ",t);
}

else
break
;
}

i
=j;
n
++;
printf
("\n");

}

getch
();
return
0;
}
21 Feb 2014

0 nhận xét:

Đăng nhận xét

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

domain, domain name, premium domain name for sales

Bài đăng phổ biến