diff options
Diffstat (limited to 'txt.txt')
-rw-r--r-- | txt.txt | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +program exemplo1
+ var
+ n, s, i: integer;
+ procedure soma;
+ var q: integer;
+ begin
+ q:=i*i;
+ if (i div 2)*2 = i then
+ s:=s+q;
+ else
+ s:=s-q;
+ end;
+begin
+ read(n);
+ s:=0; i:=0;
+ while i<=n do
+ begin
+ soma;
+ write (s);
+ i:=i+1;
+ end
+end.
+
+
\ No newline at end of file |