Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // lab6_2.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {int i;
- double max, last, n, dif, x;
- cout<<"Input n"; cin>>n;
- for (int i=1; i<=n; i++){
- if(x>max) max=x;
- last=x;}
- dif=max-last;
- cout<<"difference="<<dif<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement