Nahrát soubory do „du3“
This commit is contained in:
		
							parent
							
								
									9a7faa21c9
								
							
						
					
					
						commit
						d44c09e868
					
				
							
								
								
									
										30
									
								
								du3/program.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								du3/program.c
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,30 @@
 | 
			
		||||
#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;
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user