52 lines
1.0 KiB
C
52 lines
1.0 KiB
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#define LINE_SIZE 100
|
|
|
|
//#include<conio.h>
|
|
|
|
/*void main() {
|
|
int degree,x;
|
|
int coeff[10], i;
|
|
int sum = 0;
|
|
|
|
// Getting the value of the variable
|
|
printf("\nEnter the value of x: ");
|
|
scanf("%d",&x);
|
|
|
|
// Getting the degreee of the polynomial
|
|
printf("\nEnter the degree of the polynomial: ");
|
|
scanf("%d",°ree);
|
|
|
|
// Getting the coefficients of all terms of the polynomial
|
|
printf("\nEnter the coeffients from lower order to higher order: \n");
|
|
for(i=0; i<=degree; i++) {
|
|
scanf("%d",&coeff[i]);
|
|
}
|
|
|
|
// Applying Horner's rule
|
|
sum = coeff[degree];
|
|
for(i=degree-1; i>=0; i--) {
|
|
sum = sum*x + coeff[i];
|
|
}
|
|
|
|
// Printing result
|
|
printf("\nResult: %d",sum);
|
|
}
|
|
|
|
*/
|
|
|
|
int main(){
|
|
int pole[LINE_SIZE];
|
|
int n=0;
|
|
char*vstup;
|
|
char riadok[LINE_SIZE];
|
|
do {
|
|
vstup=fgets(riadok,LINE_SIZE,stdin);
|
|
n++;
|
|
}while(*vstup!='\n');
|
|
//printf("%s",*vstup);
|
|
for(int i=0;n>i;i++){
|
|
printf("%s",vstup);
|
|
}
|
|
} |