-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.cpp
74 lines (59 loc) · 1.63 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
// main.cpp
// spreadsheet
//
// Created by Irit Katriel on 15/07/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#include "spreadsheet.hpp"
#include <iostream>
int main (int argc, const char * argv[])
{
using namespace spreadsheet;
Spreadsheet sheet;
Cell<double> a = sheet.NewCell<double>();
Cell<double> b = sheet.NewCell<double>();
Cell<double> c = sheet.NewCell<double>();
Cell<double> d = sheet.NewCell<double>();
Cell<double> e = sheet.NewCell<double>();
Cell<double> f = sheet.NewCell<double>();
c.Set(SQRT(a()*a() + b()*b()));
a.Set(3.0);
b.Set(4.0);
d.Set(c()+b());
e.Set(d()+c());
std::cout << " a=" << a.Value()
<< " b=" << b.Value()
<< " c=" << c.Value()
<< " d=" << d.Value()
<< " e=" << e.Value()
<< std::endl;
c.Set(2*(a()+b()));
c.Set(4*(a()+b()));
c.Set(5*(a()+b()));
c.Set(6*(a()+b()));
c.Set(7*(a()+b()));
c.Set(8*(a()+b()));
c.Set(a());
std::cout << " a=" << a.Value()
<< " b=" << b.Value()
<< " c=" << c.Value()
<< " d=" << d.Value()
<< " e=" << e.Value()
<< std::endl;
c.Set(2*(a()+b()));
c.Set(4*(a()+b()));
c.Set(5*(a()+b()));
c.Set(6*(a()+b()));
c.Set(7*(a()+b()));
c.Set(8*(a()+b()));
c.Set(a()+1);
std::cout << " a=" << a.Value()
<< " b=" << b.Value()
<< " c=" << c.Value()
<< " d=" << d.Value()
<< " e=" << e.Value()
<< std::endl;
std::cout << "Goodbye!\n";
return 0;
}