ΠΙΝΑΚΑΣ ΣΥΖΗΤΗΣΕΩΝ ΓΙΑ ΤΗ ΦΥΣΙΚΗ
Θέλετε να αντιδράσετε στο μήνυμα; Φτιάξτε έναν λογαριασμό και συνδεθείτε για να συνεχίσετε.
Αναζήτηση
 
 

Αποτελέσματα Αναζήτησης
 


Rechercher Σύνθετη Αναζήτηση

Πρόσφατα Θέματα
» ΠΑΛΙΟΣ ΠΙΝΑΚΑΣ ΣΥΖΗΤΗΣΕΩΝ
Λυσεις Παλαιών Θεμάτων Empty16/3/2018, 21:23 από valpabueno

» Με γεια...!
Λυσεις Παλαιών Θεμάτων Empty14/2/2018, 16:20 από animae

» ΦΥΣΙΚΗ ΤΗΣ ΓΗΣ -ΔΥΝΑΜΙΚΗ ΤΩΝ ΣΕΙΣΜΩΝ
Λυσεις Παλαιών Θεμάτων Empty17/3/2017, 13:35 από dologlou

» apotelesmata
Λυσεις Παλαιών Θεμάτων Empty11/7/2016, 12:13 από BlackPopPorn

» τι να διαβάσω;
Λυσεις Παλαιών Θεμάτων Empty30/5/2016, 13:27 από TOLOUDA

» Αγγλικά για Μεταπτυχιακό!
Λυσεις Παλαιών Θεμάτων Empty28/5/2016, 23:16 από Kwnstantinos_L

» Αποτελέσματα
Λυσεις Παλαιών Θεμάτων Empty26/5/2016, 15:16 από valpabueno

» πα(πα)ραεπιστήμη
Λυσεις Παλαιών Θεμάτων Empty30/3/2016, 22:21 από frankenfed

» Σημειώσεις
Λυσεις Παλαιών Θεμάτων Empty2/3/2016, 10:46 από Nerd

ΕΟΡΤΟΛΟΓΙΟ

Πρωτοσέλιδα εφημερίδων


Λυσεις Παλαιών Θεμάτων

2 απαντήσεις

Πήγαινε κάτω

Λυσεις Παλαιών Θεμάτων Empty Απ: Λυσεις Παλαιών Θεμάτων

Δημοσίευση από valpabueno 30/9/2015, 12:54

Γνωριζει κανεις ποτε να αναμενουμε τα αποτελέσματα?

valpabueno

Posts : 22
Join date : 09/03/2015

Επιστροφή στην κορυφή Πήγαινε κάτω

Λυσεις Παλαιών Θεμάτων Empty Απ: Λυσεις Παλαιών Θεμάτων

Δημοσίευση από The Doctor 28/2/2015, 20:46

Οκτώβριος 2014

Θέμα 2ο

Κώδικας:
#include <stdio.h>
#include <math.h>
double rho(int a,int b,int c);
double s(int k,int l,int m);
double p(int k,int l,int m);
int main(void)
{
    int a,b,c;
    double r;
    FILE *fp;
    fp=fopen("results.dat","w");
    do
    {
        printf("Give value for a,bigger or equal than 0 and smaller than 20\n");
        scanf("%d",&a);
    }
    while(a<0||a>=20);
    do
    {
        printf("Give value for b,bigger or equal than 0 and smaller than 20\n");
        scanf("%d",&b);
    
    }
    while( b<a || b>=20);
    do
    {
      printf("Give value for c,bigger or equal than 0 and smaller than 5\n");
      scanf("%d",&c);
    }
    while(c<0 || c>=5);
        
r=rho(a,b,c);
    printf("a=%d   ",a);
    fprintf(fp,"a=%d   ",a);
    printf("b=%d   ",b);
    fprintf(fp,"b=%d   ",b);
    printf("c=%d   \n",c);
    fprintf(fp,"c=%d   \n",c);
    printf("r=%.5lf",r);
    fprintf(fp,"r=%.5lf",r);
    fclose(fp);
return 0;
    }
double rho(int a,int b,int c)
    {
        double r;
        r=( p(a,b,c)+ s(2*a,3*b,c+2) )/( pow(a,c)+pow(b,-c)+ s(a+2,2*a+4,c-10) ) + (s(4+b,20+a,2*c)+p(2*b,3*b+2,a))/(a*b*c+p(a,a+2,a*2));
        return r;
    }
double s(int k,int l,int m)
    {
        double sum=0;
        while(k<=l)
        {
            sum+=pow(k,m);
            k++;
        }
        return sum;
    }
double p(int k,int l,int m)
    {
        double multi=1;
        while(k<=l)
        {
            multi*=pow(k,m);
            k++;
        }
    return multi;
    }

Θέμα 3ο

Κώδικας:
 #include <stdio.h>
 #include <math.h>
 int main(void)
 {  
double s1,s2,s3;
int i,n;
FILE *fp;
    fp=fopen("text.txt","w");
    printf("Give value for S1=");
    scanf("%lf",&s1);
    printf("Give value for S2=");
    scanf("%lf",&s2);    
    printf("Give value for N=");    
    scanf("%d",&n);
    printf("S[1]=%.3lf\n",s1);
    fprintf(fp,"%.3lf ",s1);
    printf("S[2]=%.3lf\n",s2);
    fprintf(fp,"%.3lf ",s2);
    for(i=1;i<=n-2;i++)  \
    {
    s3=(sqrt(s1)/sqrt(i))+(pow(s2,2)/sqrt(i+1));  
    s1=s2;
    s2=s3;
    printf("S[%d]=%.3lf\n",i+2,s3);
    fprintf(fp,"%.3lf ",s3);        
    }  
fclose(fp);
    return 0;
}

Θέμα 4ο

Κώδικας:
#include <stdio.h>
#include <math.h>
int main(void)
{
int i,j,n;
double min;
FILE *fp;
    fp=fopen("data.txt","w");
    printf("Give value N=");
    scanf("%d",&n);
    double a[n][n];
    for(i=0;i<n;i++)
        for(j=0;j<n;j++)
        {
            printf("Give value for a[%d][%d]=",i+1,j+1);
            scanf("%lf",&a[i][j]);
        }
    
    
    for(i=0;i<n;i++)
    {
        min=a[i][0];
        for(j=0;j<n;j++)
        {
            if(a[i][j] < min)
             min=a[i][j];
        }
    printf("Minimum value of line %d %.3lf\n",i+1,min);
    fprintf(fp,"%.3lf \t",min);
        }
fclose(fp);
return 0;
}
The Doctor
The Doctor

Posts : 12
Join date : 28/02/2015

Επιστροφή στην κορυφή Πήγαινε κάτω

Λυσεις Παλαιών Θεμάτων Empty Απ: Λυσεις Παλαιών Θεμάτων

Δημοσίευση από The Doctor 28/2/2015, 20:42

Ιούνιος 2014

Θέμα 2ο

Κώδικας:
#include <stdio.h>
#include <math.h>
double rho(int a,int b);
double pi(int i,int k);
double es(int i,int k);
int main(void)
{
    int a,b;
    double r;
    FILE *fp;
    fp=fopen("results.dat","w");
    do
    {
        printf("Give value for a bigger than 0 and smaller or equal than 10=");
        scanf("%d",&a);
    }
    while(a<=0 ||a>10);
    do
    {
        printf("\nGive value for b bigger than 0 and smaller or equal than 10=");
        scanf("%d",&b);
    }  
    while(b<=a||b>10);
    r=rho(a,b);
    printf(" %d\n %d\n %lf\n",a,b,r);
    fprintf(fp," %d\n %d\n %lf\n",a,b,r);
    fclose(fp);
    return 0;
}
double rho(int a,int b)
{
    double r;
    r=(pi(2+a,1+b)+es(3+2*a,5+3*b))/(a+b+pow(es(5+a,20+a*2),(1/b)));
    return r;
}
double es(int i,int k)
{
    double sum=0;
    do
    {
        sum+=pow(k,i);
        k--;
    }
    while(k>=1);
    return sum;
}
double pi(int i,int k)
{
    double multi=1;
    do
    {
        multi*=pow(k,i);
        k--;
    }
    while(k>=1);
    return multi;
}

Θέμα 3ο

Κώδικας:
#include <stdio.h>
#include <math.h>
int main(void)
{
    double a,b;
    int i,n;
    double dx,sum=0;
    printf("Give value for a=");
    scanf("%lf",&a);
    do
    {
        printf("Give value for b bigger than a:");
        scanf("%lf",&b);
    }
    while(b<=a);
    do
    {
        printf("Give value for N bigger than 0:");
        scanf("%d",&n);
    }
    while(n<=0);
    dx=(a+b)/2;
    for(i=0;i<n+1;i++)
    {
        sum+=exp(-pow((a+dx*i),2))*dx;
    
    }
    sum-=exp(-pow(b,2))*dx;
    printf("Value of integral=%lf",sum);
    return 0;
}
        
        

Θέμα 4ο

Κώδικας:
#include <stdio.h>
#include <math.h>
#define N 3
double metro(double x1,double y1,double x2,double y2);
int main(void)
{
    double x[N],y[N];
    double a,b,c,circum;
    int i;
    FILE *fp;
    fp=fopen("triangle.txt","w");
    for(i=0;i<N;i++)
    {
        printf("Give value for x[%d]=",i+1);
        scanf("%lf",&x[i]);
        printf("Give value for y[%d]=",i+1);
        scanf("%lf",&y[i]);
    }
    a=metro(x[0],y[0],x[1],y[1]);
    b=metro(x[1],y[1],x[2],y[2]);
    c=metro(x[0],y[0],x[2],y[2]);
    circum=a+b+c;
    if(pow(a,2)+pow(b,2)==pow(c,2))
        printf("The triangle is right");
    printf("a=%lf,b=%lf,c=%lf,circumference=%lf",a,b,c,circum);
    fprintf(fp,"a=%lf,b=%lf,c=%lf,circumference=%lf",a,b,c,circum);
    return 0;
}
double metro(double x1,double y1,double x2,double y2)
{
    double length;
    length=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
    return length;
}
        


Έχει επεξεργασθεί από τον/την The Doctor στις 28/2/2015, 20:47, 1 φορά
The Doctor
The Doctor

Posts : 12
Join date : 28/02/2015

Επιστροφή στην κορυφή Πήγαινε κάτω

Λυσεις Παλαιών Θεμάτων Empty Λυσεις Παλαιών Θεμάτων

Δημοσίευση από The Doctor 28/2/2015, 20:39

Είναι οι λύσεις του κώδικα για τα θέματα του 2014.
Ναι το ξέρω πως μόλις το δώσαμε το μάθημα και δεν έχει και πολύ νόημα πλέον...ίσως να χρησιμέψει σε όσους θα το δώσουν και τον Σεπτέμβρη.

Μάιος 2014

Θέμα 2ο
Κώδικας:
#include<stdio.h>
int main(void)
{
   
   int i, n;
    double an0, an1, an2;
    FILE *fp;
    fp=fopen("fibonacci.txt","w");
    do
    {
   printf("Give value for N>=2: N = ");
   scanf("%d",&n);}
    while(n<2);
    printf("\nGive value for S[0]=");
    scanf("%lf",&an0);
    printf("\nGive value for S[1]=");
    scanf("%lf",&an1);
    printf("\nS[0]=%.3lf",an0);
    printf("\nS[1]=%.3lf",an1);
    fprintf(fp,"\nS[0]=%.3lf",an0);
    fprintf(fp,"\nS[1]=%.3lf",an1);
   for (i = 2; i<=n; ++i)
   {
      an2 = an1+an0;
      an0 = an1;
        an1 = an2;
        printf("\nS[%d]=%.3lf",i,an2);
        fprintf(fp,"\nS[%d]=%.3lf",i,an2);
        }
    fclose(fp);
    return 0;
}

Θέμα 3ο
Κώδικας:
#include <stdio.h>
#include <math.h>

int main(void)
{
   double a,b,n,sum,h;
   int i;
    FILE *fp;
    fp=fopen("int.txt","w");
   
   printf("Give value for a=");
    scanf("%lf", &a);
    do
    {
   printf("\nGive value for b=");
    scanf("%lf", &b);
    }
    while(b<=a);
            
   printf("\nGive value for N\n");
    scanf("%lf", &n);
    
    h = (b-a)/n;
    
    sum = 0.0;
    
    for (i=0; i<n+1; ++i)
        sum += (1/(pow(a+h*i,2)+exp(a+h*i)))*h;
        
    sum -= 0.5*h*(pow(a,2)+exp(a)+pow(b,2)+exp(b));    
               
   printf("Value of the integral = %lf \n", sum);
    fprintf(fp,"Value of the integral = %lf \n", sum);
    fclose(fp);
   

   return 0;
}

Θέμα 4ο
Κώδικας:
#include <stdio.h>
#include <math.h>
int main(void)
{
   int i,n;
printf("Give value for n=");
scanf("%d",&n);
double x[n],y[n];
double sum_xy=0,sum_x=0,sum_y=0,sum_xsqrt=0;
double a,b;
FILE *fp;
    fp=fopen("results.dat","w");
for(i=0;i<n;i++)
{
    printf("Give value for x[%d]=",i+1);
    scanf("%lf",&x[i]);
    fprintf(fp,"%lf ",x[i]);
    printf("Give value for y[%d]=",i+1);
    scanf("%lf",&y[i]);
    fprintf(fp,"%lf\n",y[i]);
    sum_xy+=x[i]*y[i];
    sum_x+=x[i];
    sum_y+=y[i];
    sum_xsqrt+=pow(x[i],2);
}
    
    a=((n*sum_xy)-(sum_x*sum_y))/((n*sum_xsqrt)-pow(sum_x,2));
    b=((sum_xsqrt*sum_y)-(sum_x*sum_xy))/((n*sum_xsqrt)-pow(sum_x,2));
printf("Value for a=%lf ",a);
fprintf(fp,"\na=%lf",a);
printf("Value for b=%lf ",b);
fprintf(fp,"b=%lf",b);
fclose(fp);
    
    return 0;
}


Έχει επεξεργασθεί από τον/την The Doctor στις 28/2/2015, 20:47, 1 φορά
The Doctor
The Doctor

Posts : 12
Join date : 28/02/2015

Επιστροφή στην κορυφή Πήγαινε κάτω

Επιστροφή στην κορυφή

- Παρόμοια θέματα

 
Δικαιώματα σας στην κατηγορία αυτή
Δεν μπορείτε να απαντήσετε στα Θέματα αυτής της Δ.Συζήτησης