This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int n; | |
| printf("Nhap so phan tu cua mang: ");scanf("%d", &n); | |
| int a[n]; | |
| for(int i=0;i<n;i++) | |
| { | |
| printf("a[%d]=",i);scanf("%d", &a[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // n sang so nhi phan co 8 chu so | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int n; | |
| int a[8]; | |
| do | |
| { | |
| printf("n=");scanf("%d",&n); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // tim UCLN cua a,b. | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int a,b; | |
| printf("a=");scanf("%d",&a); | |
| printf("b=");scanf("%d",&b); | |
| if(a>b) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // tim n nho nhat sao cho 1+2...n<100000 | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| long s=0,i; | |
| for(i=1;i<=10000;i++) | |
| { | |
| s=s+i; | |
| if(s>10000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in ra so le <100 tru 15,47,29. | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| for(int i=99;i<100;i--) | |
| if(i%2==1 && i!=15 && i!=47 && i!=29) | |
| { | |
| printf("%d\t",i); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // tim ngay cua thang trong nam | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int m,y; | |
| do | |
| { | |
| printf("month = ");scanf("%d",&m); | |
| printf("year = ");scanf("%d",&y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 200000 tu 1000,2000 va 5000 | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int i,j,k; | |
| long long a,b,c; | |
| for(i=1;i<=200;i++) | |
| { | |
| a=i*1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // chuong trinh in ra bang cuu chuong | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int d=0,h; | |
| for(int i=1;i<=9;i++) | |
| { | |
| for(int j=1;j<=9;j++) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // viet chuong trinh in ra tam giac can co chieu cao h | |
| #include <stdio.h> | |
| #include <Conio.h> | |
| int main() | |
| { | |
| int h; | |
| printf("Nhap chieu cao h=");scanf("%d",&h); | |
| for(int i=1;i<=h;i++) | |
| { | |
| for(int j=1;j<=h-i;j++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //liet ke so le cua n | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int n,t; | |
| do{ | |
| printf("n=");scanf("%d",&n); | |
| } | |
| while(n<=0); |