This file contains 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 argc, char *argv[]) | |
{ | |
int n; | |
long long s=0; | |
printf("n=");scanf("%d",&n); | |
for(int i=1;i<=n;i++) | |
s=s+i; | |
printf("S(%d)=%ld",n,s); |
This file contains 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> | |
int main(int argc, char *argv[]) | |
{ | |
int a[3]; | |
int max=0; | |
printf("Nhap 3 so:"); | |
for(int i=0;i<=2;i++) | |
{ | |
scanf("%d",&a[i]); | |
} |
This file contains 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> | |
int search(int a,int b,int c) | |
{ | |
if(a<b&&a>c || a>b&&a<c) | |
return a; | |
else if(b<a&&b>c||b>a &&b<c) return b; | |
else return c; | |
} | |
int main() | |
{ |
This file contains 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
// giai pt ax+b=0 | |
#include <stdio.h> | |
int main() | |
{ | |
int a,b; | |
printf("a=");scanf("%d",&a); | |
printf("b=");scanf("%d",&b); | |
if(a==0&&b==0) printf("PT co vo so nghiem"); | |
if(a==0&&b!=0) printf("PT vo nghiem"); | |
if(a!=0&&b!=0) printf("PT co nghiem la %f",float(-b)/a); |
This file contains 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
// giai pt bac 2 | |
#include <stdio.h> | |
#include <math.h> | |
#include <conio.h> | |
int main(int argc, char *argv[]) | |
{ | |
int a,b,c,d; | |
printf("a=");scanf("%d",&a); | |
printf("b=");scanf("%d",&b); | |
printf("c=");scanf("%d",&c); |
This file contains 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 trình xep hang hoc luc cua mot hoc sinh | |
#include <stdio.h> | |
#include <conio.h> | |
#include <conio.h> | |
int main () | |
{ | |
int n; | |
do | |
{ | |
printf("Nhap diem cua ban: ");scanf("%d",&n); |
This file contains 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
// bai 7 | |
#include <stdio.h> | |
#include <conio.h> | |
int main() | |
{ | |
int a,b,c; | |
printf("a=");scanf("%d",&a); | |
printf("b=");scanf("%d",&b); | |
printf("c=");scanf("%d",&c); | |
if(a==10 && b!=10 && c!=10) printf("DUNG"); |
This file contains 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
// sap xep 4 so theo thu tu giam dan | |
#include <stdio.h> | |
#include <conio.h> | |
int main() | |
{ | |
int a[4]; | |
printf("nhap 4 so:"); | |
for(int i=0;i<4;i++) | |
scanf("%d",&a[i]); | |
for(int i=0;i<4;i++) |
This file contains 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
// tong so le | |
#include <stdio.h> | |
#include <conio.h> | |
int main() | |
{ | |
int x[3]; | |
int s=0; | |
for(int i=0;i<3;i++) | |
{ | |
printf("Nhap 3 so: ");scanf("%d",&x[i]); |
This file contains 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
// tinh luong sau thue | |
#include <stdio.h> | |
#include <conio.h> | |
int main() | |
{ | |
double n; | |
printf("Nhap luong truoc thue(trieu): ");scanf("%lf",&n); | |
if(n<7) | |
{ | |
printf("Luong sau thue la(trieu) %lf",1.0*(n-0.11*n)); |
OlderNewer