Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bt6 #6

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e864749
Create Variable.c
nguyenminhvuong20002 Nov 12, 2020
de6122a
Create pheptinh.c
nguyenminhvuong20002 Nov 26, 2020
5b6b947
Update pheptinh.c
nguyenminhvuong20002 Nov 26, 2020
7374983
Update pheptinh.c
nguyenminhvuong20002 Nov 26, 2020
23b11b8
Update pheptinh.c
nguyenminhvuong20002 Nov 26, 2020
4deb702
Create chuvi.c
nguyenminhvuong20002 Nov 26, 2020
de18415
Create tong.c
nguyenminhvuong20002 Dec 3, 2020
d70b8e9
Create chieudai.c
nguyenminhvuong20002 Dec 3, 2020
e5a2149
Create ketquahoctap.c
nguyenminhvuong20002 Dec 3, 2020
31b72a1
Update ketquahoctap.c
nguyenminhvuong20002 Dec 3, 2020
ad027e4
Create amduong.c
nguyenminhvuong20002 Dec 10, 2020
fe4c092
Create sosanh.c
nguyenminhvuong20002 Dec 10, 2020
6dfa46c
Create hondon.c
nguyenminhvuong20002 Dec 10, 2020
5cf94ca
Update hondon.c
nguyenminhvuong20002 Dec 17, 2020
f2ed138
Create phepinh.c
nguyenminhvuong20002 Dec 17, 2020
3055f00
Create thang.c
nguyenminhvuong20002 Dec 17, 2020
860aaf3
Create xinchao.c
nguyenminhvuong20002 Dec 24, 2020
23537e6
Create motdenmuoi.c
nguyenminhvuong20002 Dec 24, 2020
9c8236f
Update motdenmuoi.c
nguyenminhvuong20002 Dec 24, 2020
4d13987
Create Ghichu.txt
nguyenminhvuong20002 Dec 24, 2020
b8d3c55
Update motdenmuoi.c
nguyenminhvuong20002 Dec 24, 2020
2742edb
Create tong10.c
nguyenminhvuong20002 Dec 24, 2020
6ecd23d
Create tamgiacso.c
nguyenminhvuong20002 Dec 30, 2020
5a7b567
Add files via upload
nguyenminhvuong20002 Jan 7, 2021
f6aaa6e
Add files via upload
nguyenminhvuong20002 Jan 7, 2021
2c51357
Create kt01_c
nguyenminhvuong20002 Jan 7, 2021
4ab9179
Create kt01_c
nguyenminhvuong20002 Jan 7, 2021
30d7038
Rename kt01_c to kt01.c
nguyenminhvuong20002 Jan 7, 2021
b9cbaa7
Create kt04.c
nguyenminhvuong20002 Jan 8, 2021
291f8cb
Create kt03.c
nguyenminhvuong20002 Jan 8, 2021
933df4f
Create kt06.c
nguyenminhvuong20002 Jan 8, 2021
3e2ee6b
Create mang_01.c
nguyenminhvuong20002 Jan 14, 2021
29653b4
Update mang_01.c
nguyenminhvuong20002 Jan 14, 2021
44cde90
Create mang_02.c
nguyenminhvuong20002 Jan 19, 2021
735fadf
Create mang_04.c
nguyenminhvuong20002 Jan 19, 2021
b3e8522
Create mang_05.c
nguyenminhvuong20002 Jan 21, 2021
a107081
Update mang_05.c
nguyenminhvuong20002 Jan 22, 2021
ed0655e
Create ham_01.c
nguyenminhvuong20002 Jan 22, 2021
412d0d4
Create ham_21.c
nguyenminhvuong20002 Jan 22, 2021
c9c7784
Rename ham_21.c to ham_02.c
nguyenminhvuong20002 Jan 22, 2021
1c04f04
Create LyThuyet.txt
nguyenminhvuong20002 Jan 23, 2021
55db7ba
Create TH_02.c
nguyenminhvuong20002 Jan 23, 2021
fca2075
Create TH_03.c
nguyenminhvuong20002 Jan 23, 2021
5d3ddd1
Create yeucau1.c
nguyenminhvuong20002 Mar 20, 2021
eba85b9
Create yeucau2.c
nguyenminhvuong20002 Mar 20, 2021
e950de8
Create yeucau3.c
nguyenminhvuong20002 Mar 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Bài tập 1/Variable.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
int main() {
// khai bao bien a kieu so nguyen
int a;
// khoi tao gia tri bien a
a = 4;
// khai bao va khoi tao bien
int b = 2;
// khai bao nhieu bien va khoi tao
int c= 1, d = 3;
// khai bao nhieu bien
int e, f, g;
printf("bien a = %d va bien b = %d",a,b);
e = a + b;
printf("\n");
printf("Tong a + b = %d",e);
printf("\n");
printf("Tong %d + %d = %d",a,b,e);
printf("\n");
g = ((a + b) - c) * d;
printf("( %d + %d ) - %d)* %d = %d ",a,b,c,d,g);
getchar();
return 0;
}
21 changes: 21 additions & 0 deletions Bài tập 1/chuvi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <stdio.h>

int main(){
//khai bao bien
double R;
R = 2.5;
//khai bao hang
const double PI = 3.14;
//khai bao nhieu bien
double CV, DT;
printf("R=%.1f", R);
printf("\n");
printf("PI:%.2f",PI);
CV = (double) 2*R*PI;
DT = (double) R*R*PI;
printf("\n\n");
printf("2*R*PI\tR*R*PI\n%.1f\t%.1f",CV,DT);

getchar();
return 0;
}
19 changes: 19 additions & 0 deletions Bài tập 1/pheptinh.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdio.h>

int main (void){

int a ;int b;
a=3;b=5;

a+b; a-b; a*b; a/b;

double c = 3;
double d = 5;

printf("a\t b\t a+b\t a-b\t a*b\t a/b\n");

printf("%d\t %d\t %d\t %d\t %d\t %g",a,b,a+b,a-b,a*b,c/d);


return 0;
}
14 changes: 14 additions & 0 deletions Bài tập 2/chieudai.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>
int main(){

//nhap chieu dai l theo don vi gia tri ban phim
int l,i,f;
printf("nhap chieu dai Met (M): %d", l);
scanf("%d", &l);
i=l*100;
f=l*1000;
printf("\nXentimet (Cm) la: %d", i);
printf("\nMilimet (Mm) la: %d", f);
return 0;

}
14 changes: 14 additions & 0 deletions Bài tập 2/ketquahoctap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>

int main(void) {

int V,T,Van,Toan;
double DTB;
DTB=(double)(V+T)/2;
printf ("Nhap V =");
scanf ("%d",&V);
printf (" Nhap T =");
scanf ("%d",&T);
printf("Van\tToan\tDTB\n%d\t%d\t%0.1f",Van,Toan,DTB);
return 0 ;
}
14 changes: 14 additions & 0 deletions Bài tập 2/tong.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>

//nhap so a, b tu ban phim
//hien thi tong a va b
int main(void){
int a, b;
printf("nhap a = ");
scanf("%d",&a);
printf("nhap b = ");
scanf("%d",&b);
printf("a + b = %d", a + b);
return 0 ;

}
3 changes: 3 additions & 0 deletions Bài tập 3/Ghichu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dem = dem + 1
<=> dem + =1
<=> dem ++
Binary file added Bài tập 3/Review_01.c.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Bài tập 3/amduong.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <stdio.h>

int main(void){
int a;
printf("nhap a tu ban phim :");
scanf("%d", &a);
if(a > 0){
printf("%d duong", &a);
}else if(a == 0) {
printf("%d = 0", a);
}else{
printf("%d am", a);
}

getchar();
return 0;
}
16 changes: 16 additions & 0 deletions Bài tập 3/hondon.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>

int main(){
int dongia, soluong, thanhtien;
printf("nhap don gia :",dongia);
scanf("%d",&dongia);
printf("nhap soluong :",soluong);
scanf("%d",&soluong);
thanhtien=dongia*soluong;
if(thanhtien>=500&&dongia>=5){thanhtien=(dongia*soluong)*0.5;
printf("%d", thanhtien);
}else{printf("%d",thanhtien);
}
getchar();
return 0;
}
12 changes: 12 additions & 0 deletions Bài tập 3/kt01.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdio.h>
int main() {
printf("BANG CUU CHUONG");printf("\n");
printf("Bang 2");printf("\n");
printf("2*1=2\n2*2=4\n2*3=6\n");
printf("Bang 3");printf("\n");
printf("3*1=3\n3*2=6\n3*3=9\n");
printf("Bang 4");printf("\n");
printf("4*1=4\n4*2=8\n4*3=12");
return 0;

}
12 changes: 12 additions & 0 deletions Bài tập 3/kt01/kt01_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdio.h>
int main() {
printf("BANG CUU CHUONG");printf("\n");
printf("Bang 2");printf("\n");
printf("2*1=2\n2*2=4\n2*3=6\n");
printf("Bang 3");printf("\n");
printf("3*1=3\n3*2=6\n3*3=9\n");
printf("Bang 4");printf("\n");
printf("4*1=4\n4*2=8\n4*3=12");
return 0;

}
11 changes: 11 additions & 0 deletions Bài tập 3/kt03.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include<stdio.h>
int main()
{
int a;
for(a = 1; a <= 20; a+=2)
{
if((a == 5) or (a == 11) or (a == 15))continue;
printf("%5d", a);
}
return 0;
}
11 changes: 11 additions & 0 deletions Bài tập 3/kt04.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <stdio.h>
int main() {
int n = 123;
int s = 0;
while(n!=0){
s = s + n%10;
n = n/10;
}
printf("s = %d",s);
return 0;
}
23 changes: 23 additions & 0 deletions Bài tập 3/kt06.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include<stdio.h>
int n;
int main(){
printf("nhap n");
scanf("%d", &n);
switch(n){
case 1:
printf("*");
break;
case 2:
printf("\t*\n*\t*\t*");
break;
case 3:
printf("\t\t*\n\t*\t*\t*\n*\t*\t*\t*\t*");
break;
case 4:
printf("\t\t\t*\n\t\t*\t*\t*\n\t*\t*\t*\t*\t*\n*\t*\t*\t*\t*\t*\t*");
break;
}
getchar();
return 0;
}

10 changes: 10 additions & 0 deletions Bài tập 3/motdenmuoi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include<stdio.h>
int main(void){
int count;
for (count =1; count <=1; count++ ){
printf("1\t2\t3\t4\t5\t6\t7\t8\t9\t10\n");
} for (count =1; count <=1; count++ ){
printf("2\n3\n4\n5\n6\n7\n8\n9\n10");
}

}
20 changes: 20 additions & 0 deletions Bài tập 3/phepinh.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdio.h>

int main(void){
int a = 5, b = 2;
char pt;
printf("Vui long nhap phep tinh: ");
scanf("%c", &pt);
switch (pt) {
case ('+'):
printf ("a+b=%d",a+b);
break ;
case ('-'):
printf ("a-b=%d",a-b);
break ;

default :
printf ("vui long nhap phep tinh");
}
return 0 ;
}
18 changes: 18 additions & 0 deletions Bài tập 3/sosanh.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include<stdio.h>

int main(){
//khai bao bien a, b
int a, b;
printf("nhap a tu ban phim :",a);
scanf("%d", &a);
printf("nhap b tu ban phim :",b);
scanf("%d", &b);
if(a > b){
printf("a>b",a,b);
}else if( a== b){
printf("a==b",a,b);
}else if(a < b){
printf("a<b ",a,b);
}
return 0;
}
18 changes: 18 additions & 0 deletions Bài tập 3/tamgiacso.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>

int main (void)
{
int a,b;
int n;
printf("Nhap vao n= ");
scanf("%d",&n);
for (a=1; a<= n ; a++ )
{
printf("\n");
for(b=1;b<=a;b++)
{
printf("%d ",b);
}
}
return 0 ;
}
28 changes: 28 additions & 0 deletions Bài tập 3/thang.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <stdio.h>

int main(void){
int thang;
printf("Vui long nhap thang:");
scanf("%d",&thang);
switch (thang){
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
printf(" 30 ngay ");break;
case 4:
case 6:
case 9:
case 11:
printf(" 31 ngay ");break;
case 2:
printf(" 28 ngay ");break;
default:

printf("Vui long nhap phep tinh");
}
return 0;
}
7 changes: 7 additions & 0 deletions Bài tập 3/tong10.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include<stdio.h>
int main(void){
int tong =0;
for(int dem = 1; dem <=10; dem++){tong = tong + dem;
}
printf("tong la: %d",tong);
}
8 changes: 8 additions & 0 deletions Bài tập 3/xinchao.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include<stdio.h>
int main(void){
int count;
for (count =1; count <=10; count++ ){
printf("\n xin chao ");
}

}
14 changes: 14 additions & 0 deletions Bài tập 4/mang_01.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>

int main() {
int a[4]={3,5,7,2};
int k,tong=0;

for(int k = 0; k < 4; ++k){
tong +=a[k];
printf("%d\n", a[k]);
}
printf("TONG = %d",tong);
return 0;
}

26 changes: 26 additions & 0 deletions Bài tập 4/mang_02.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include<stdio.h>
int main(){

int n;
printf("Nhap n = ");
scanf("%d", &n);
//tao namg a kich thuoc n
int a[n];
//nhap n phan tu cua mang a tu ban phim
for(int i = 0 ;i < n; i++){
printf("nhap phan tu thu %d",i + 1);
scanf("%d", &a[i]);
printf("\n");
}
printf("mang a:");
for(int i = 0 ;i < n; i++){
printf("%d",a[i]);

}
printf("\nso chan:");
for(int i = 0; i <n; i++) {
if(a[i]%2 == 0)
printf("%d", a[i]);

}
}
Loading