Commit 0f351ac6 authored by Nighz's avatar Nighz
Browse files

Renaming depricated files

parent 82877d3c
#include <iostream>
using namespace std;
int main()
{
float f, ausgabe;
cout<<"Bitte Temp. in Grad Fahrenheit: ";
cin>>f;
ausgabe = (5.0 / 9) * (f - 32);
cout<<"Temperatur in Grad Celsius: "<<ausgabe;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
float t, s, v, g = 9.81;
cout<<"Bitte Zeit eingeben: ";
cin>>t;
v = t * g;
s = 0.5 * v * t; //alternativ g * t * t * 0.5
cout<<"Strecke: "<<s<<" m\nGeschwindigkeit: "<<v<<" m/s";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
float masse, volumen, gehalt, bak;
cout<<"Bitte Masse in kg, Volumen in ml und Alkoholgehalt in % angeben: ";
cin>>masse>>volumen>>gehalt;
bak = (volumen * gehalt * 0.8 / 100) / (masse * 0.62);
cout<<"BAK: "<<bak<<" Promille";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
char a;
cout<<"Sind Sie krank? (y/n): ";
cin>>a;
if(a == 'y')
{
cout<<"Gute Besserung!";
}
if(a == 'n')
{
cout<<"Das ist gut!";
}
if(a != 'y' && a != 'n')
{
cout<<"Falsche Eingabe.";
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int i = 1, summe = 0, n;
cout<<"Bitte geben Sie n ein: ";
cin>>n;
if(n < 0)
{
cout<<"Zahl ungueltig.";
return 1;
}
for(i; n > 0; i++)
{
if(i % 2 == 0)
{
summe += i;
n--;
}
}
cout<<"Die Summe ist: "<<summe;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a[5][3], b[5][3], c[5][3];
for(int i = 0; i < 5; i++) //Zeilen
{
for(int j = 0; j < 3; j++) //Spalten
{
cout<<"Zeile "<<i+1<<", Spalte "<<j+1<<" : ";
cin>>a[i][j];
b[i][j] = a[i][j] * a[i][j];
c[i][j] = b[i][j] + a[i][j];
}
}
for(int i = 0; i < 3; i++)
{
int sum = 0;
for(int j = 0; j < 5; j++)
{
sum += a[j][i];
}
cout<<"Spaltensumme Spalte "<<i+1<<" : "<<sum<<"\n";
}
cout<<"\nMatrix C:\n";
for(int i = 0; i < 5; i++)
{
for(int j = 0; j < 3; j++)
{
cout<<c[i][j]<<"\t";
}
cout<<"\n";
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int rm[6][15];
for(int i = 0; i < 6; i++)
{
cout<<"Zeile "<<i+1<<", Spalte 1 : ";
cin>>rm[i][0];
}
for(int i = 1; i < 15; i++)
{
for(int j = 0; j < 6; j++)
{
switch(j)
{
case 0:
rm[j][i] = rm[j][i-1] + rm[j+1][i-1];
break;
case 5:
rm[j][i] = rm[j][i-1] + rm[j-1][i-1];
break;
default:
rm[j][i] = rm[j-1][i-1] - rm[j][i-1] - rm[j+1][i-1];
}
}
}
cout<<"\nRM:\n";
for(int i = 0; i < 6; i++)
{
for(int j = 0; j < 15; j++)
{
cout<<rm[i][j]<<"\t";
}
cout<<"\n";
}
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
struct punkt
{
int x;
int y;
};
int main()
{
punkt punkte[10];
double max_abst = 0, min_abst;
for(int i = 0; i < 10; i++)
{
cout<<"X"<<i+1<<" : ";
cin>>punkte[i].x;
cout<<"Y"<<i+1<<" : ";
cin>>punkte[i].y;
}
min_abst = sqrt(pow(punkte[0].x, 2) + pow(punkte[0].y, 2));
for(int i = 0; i < 10; i++)
{
double abst = sqrt(pow(punkte[i].x, 2) + pow(punkte[i].y, 2));
if(abst > max_abst) max_abst = abst;
if(abst < min_abst) min_abst = abst;
}
cout<<"Minimaler Abstand: "<<min_abst<<"\nMaximaler Abstand: "<<max_abst;
return 0;
}
......@@ -21,7 +21,7 @@ int main()
{
int x = 5, t = 4;
//Die Referenz beanflussen die Variablen die der Funktion übergeben wurden
//Die Referenz beinflussen die Variablen die der Funktion übergeben wurden
cout<<x<<" "<<quer(123,x)<<"\n";
cout<<t<<" "<<quer(321,t);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment