Aktualizovat „du3/program.c“
This commit is contained in:
parent
d7319a7e5c
commit
300898b676
@ -1,30 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include<ctype.h>
|
||||
#include<math.h>
|
||||
int main()
|
||||
{
|
||||
float x=0;
|
||||
float value =0;
|
||||
int count =0;
|
||||
float arr[50];
|
||||
while(scanf("%f",&value)!=EOF){
|
||||
if(isalpha(value)!=0){
|
||||
return 0;
|
||||
}
|
||||
if(count !=0){
|
||||
arr[count-1]=value;
|
||||
}
|
||||
else{
|
||||
x=value;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
value=0;
|
||||
for(int i =0;i<count;i++){
|
||||
value+=arr[count]*pow(x,count-i);
|
||||
}
|
||||
printf("Vysledok je :%f\n",value);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
#define _XOPEN_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Enter date: ");
|
||||
|
||||
char dateStr[11];
|
||||
struct tm t;
|
||||
|
||||
fgets(dateStr, 11, stdin);
|
||||
|
||||
strptime(dateStr, "%d.%m.%Y", &t);
|
||||
|
||||
t.tm_mday += 7;
|
||||
|
||||
strftime(dateStr, sizeof(dateStr), "%d.%m.%Y", &t);
|
||||
|
||||
printf("The day of the week is %s", dateStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user