Hey, har lavet et lille slags program:
#include <algorithm>
#include <fstream>
#include <istream>
#include <sstream>
#include <iomanip>
#include <ios>
#include <iostream>
#include <string>
#include <vector>
#include <windows.h>
using namespace std;
int main()
{
	typedef vector<double>::size_type sizeafindtast;
	vector<double> indtast;
	sizeafindtast size = indtast.size();
	cout << "Indtast 5 tal: " << endl;
	double a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;
	indtast.push_back(a);
	indtast.push_back(b);
	indtast.push_back(c);
	indtast.push_back(d);
	indtast.push_back(e);
	sort(indtast.begin(), indtast.end());
	Sleep(2000);
	system("CLS");
	cout << "Indtastede tal: " << a << b << c << d << e << endl;
	Sleep(2000);
	sizeafindtast mid = size/2;
	double median;
	median = size % 2 == 0 ? (indtast[mid] + indtast[mid-1]) / 2
		: indtast[mid];
	
	cout << median << endl;
	Sleep(5000);
}Har bare et lille problem, den kommer med en eller anden meget underlig fejl.. Ved ikke hvad det kan være?
Fejl problem billed:
http://www.speedyshare.com/916918575.html
						
						
						
						
		
							Indlæg senest redigeret d. 29.03.2009 20:39 af Bruger #14212