0% found this document useful (0 votes)
14 views

Sol

Uploaded by

vasko
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Sol

Uploaded by

vasko
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

ddsfsdf#include <stdio.

h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <ctype.h>

int main()
{
int n;
int temp_first = 0;
int temp_second = 0;

int sum;
int rev;
int pass = 1;

scanf("%d",&n);

for (int i =1;i<n;i++){


for(int j =1;j<n;j++){
sum = 0;
rev = 0;
pass = 1;
if (i+j != n){
pass = 0;
}
temp_first = i;
temp_second = j;
while (temp_first > 0){
rev*=10;
rev += temp_first%10;
temp_first/=10;
}

while(temp_second > 0){


sum+=temp_second%10;
temp_second/=10;
}

if(rev % sum == 0 && pass){


printf("%d %d\n",i,j);
}
}
}
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <ctype.h>

int main()
{
int len;
scanf("%d",&len);
float brucosi_len= 0;
int brucos_pass = 0;

float points_sum =0;


float polozile_len = 0;

int index =0; float points = 0;

for(int i =0;i<len;i++){
scanf("%d%f",&index,&points);
if (points >= 40 ){
points_sum+=points;
polozile_len++;
}

if (index/10000 == 21) {
brucosi_len++;
if (points >= 40.0){
brucos_pass++;
}
}

printf("%.2f\%%\n",(brucos_pass * 100.0) / brucosi_len);

printf("%.2f",points_sum/polozile_len);
}

You might also like