Skip to content

Instantly share code, notes, and snippets.

View rkhang7's full-sized avatar
✌️

Hoàng Xuân Khang rkhang7

✌️
View GitHub Profile
@rkhang7
rkhang7 / bai1
Created November 13, 2018 12:40
#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);
@rkhang7
rkhang7 / bai2
Created November 13, 2018 12:58
#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]);
}
@rkhang7
rkhang7 / bai3
Created November 15, 2018 02:58
#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()
{
@rkhang7
rkhang7 / bai4
Created November 15, 2018 03:08
// 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);
@rkhang7
rkhang7 / bai5
Created November 15, 2018 11:52
// 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);
@rkhang7
rkhang7 / bai6
Created November 15, 2018 12:01
// 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);
@rkhang7
rkhang7 / bai7
Created November 15, 2018 12:13
// 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");
@rkhang7
rkhang7 / bai8
Created November 17, 2018 01:41
// 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++)
@rkhang7
rkhang7 / bai9
Created November 17, 2018 01:58
// 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]);
// 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));