Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stepenovanje u Dev C++
Author Message
Brenko Offline
Novi korisnik
*

Posts: 4
Joined: Jan 2010
Reputation: 0
Post: #11
RE: Stepenovanje u Dev C++
hvala na pomoći
17-01-2010 02:18 PM
Find all posts by this user Quote this message in a reply
Brenko Offline
Novi korisnik
*

Posts: 4
Joined: Jan 2010
Reputation: 0
Post: #12
RE: Stepenovanje u Dev C++
Sad sam napisao prog. da računa po toj formuli, sad treba još da računa i po drugoj formuli, sa istim parametrima



#include <cstdlib>
#include <iostream>
#include <cmath>


using namespace std;

int main()
{
//Definiranje ulaznih velicina

float focallength,nearlimit,farlimit,total,circleofconfusion;


float fstop,subjectdistance;

//Geometrijski i maseni podaci

cout << "Unesite F STOP:" << endl;
cin >> fstop;
cout << endl;
cout << "Unesite SUBJECT DISTANCE: s=" << endl;
cin >> subjectdistance;
cout << endl;

//konstante

circleofconfusion=0.019;
focallength=100;

//formula

farlimit = (subjectdistance* (((focallength*focallength)/(fstop*circleofconfusion))+focallength)-focallength)/(((focallength*focallength)/(fstop*circleofconfusion)+focallength)-subjectdistance);
cout << " Far limit je : " << endl;
cout << farlimit;
cout << endl;



Dn = (s*(((f*f)/(N*c))+f)-f)/(((f*f)/(N*c)+f)-s)

to je ta druga formula , dali mogu napisat i nju u program




system ("PAUSE");
return 0;

}
17-01-2010 03:19 PM
Find all posts by this user Quote this message in a reply
r0tring Offline
Redoviti posjetitelj
**

Posts: 230
Joined: Apr 2009
Reputation: 10
Post: #13
RE: Stepenovanje u Dev C++
Ako sam te dobro razumio, ti hoćeš da ti zadatak riješi i po drugoj formuli, ali rješenje ti je isto, ako si to htjeo, evo rješenja:

Code:
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
//Definiranje ulaznih velicina

float focallength,nearlimit,farlimit,total,circleofconfusion;


float fstop,subjectdistance;

//Geometrijski i maseni podaci

cout << "Unesite F STOP:" << endl;
cin >> fstop;
cout << endl;
cout << "Unesite SUBJECT DISTANCE: s=" << endl;
cin >> subjectdistance;
cout << endl;

//konstante

circleofconfusion=0.019;
focallength=100;

//formula

farlimit = (subjectdistance* (((focallength*focallength)/(fstop*circleofconfusion))+focallength)-focallength)/(((focallength*focallength)/(fstop*circleofconfusion)+focallength)-subjectdistance);
cout << " Far limit je : ";
cout << farlimit;
cout << endl;


// *novi dio, za rjesavanje po drugoj formuli
cout<<endl;

float Dn, s, f, N, c;
s = subjectdistance;
N = fstop;
c = circleofconfusion;
f = focallength;

Dn = (s*(((f*f)/(N*c))+f)-f)/(((f*f)/(N*c)+f)-s);

cout<<"Rjesenje po drugoj formuli: "<<Dn<<endl<<endl;
// *kraj novog dijela


system ("PAUSE");
return 0;

}
18-01-2010 10:43 AM
Find all posts by this user Quote this message in a reply
Brenko Offline
Novi korisnik
*

Posts: 4
Joined: Jan 2010
Reputation: 0
Post: #14
RE: Stepenovanje u Dev C++
hvala

uspio sam
18-01-2010 07:32 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)