Lab 5
Lab 5
Lab 5
int main() {
int i,j,n,k=0, arr[1000],mode[1000]={0},count[1000]={0};
double x=0.00,y=0.00;
scanf("%d", &n);
if(n>1000 && n<1){
return 0;
}
int main() {
int i,n,Xi,Yi,Zi,arr[100][2],count[5]={0};
double score=0, percent;
scanf("%d", &n);
if(n>100 && n<1){
return 0;
}
for(i=0 ; i<n ; i++){
scanf("%d %d %d", &Xi, &Yi, &Zi);
if(Xi > 40 && Xi<-20 , Yi>40 && Yi<-20 , Zi>20 && Zi<-20){
return 0;
}
arr[i][0]= Xi+Yi+Zi;
if(arr[i][0]>=80){
arr[i][1] = 4;
}else if(arr[i][0] >= 70){
arr[i][1] = 3;
}else if(arr[i][0] >= 60){
arr[i][1] = 2;
}else if(arr[i][0] >= 50){
arr[i][1] = 1;
}else{
arr[i][1] = 0;
}
}
for(i=0 ; i<n ; i++){
switch(arr[i][1]){
case 4:
count[0]++;
break;
case 3:
count[1]++;
break;
case 2:
count[2]++;
break;
case 1:
count[3]++;
break;
default:
count[4]++;
}
}
for(i=0 ; i<5 ; i++){
score = score + count[i];
percent = (score/n) * 100;
printf("%.0lf %.2lf\n", score, percent);
}
return 0;
}
//Finish 100 score
//ID: 66070503459 Anongnart Boonkleang
//EX3: Prime Palindrome
#include<stdio.h>
#include<math.h>
if(i>10000 || i<0){
return 0;
}
j = i+1;
while(1){
if(isPrime(j) && isPalindrome(j)){
printf("%d", j);
break;
}
j++;
}
return 0;
}
//Finish 100 score
//ID: 66070503459 Anongnart Boonkleang
//EXAM4 : Matching
#include<stdio.h>
#include<stdbool.h>
int main() {
int n,m,i,j,setA[100],setB[100];
bool output = true;
int main() {
int i,n,arr[100],count=0,Xi;
scanf("%d", &n);
int main(){
int i,n,arr[100],even=0,odd=0;
scanf("%d", &n);