Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide whitespace changes
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Text styles
Change appearance
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
91212
Created
4 years ago
Diff never expires
Clear
Export
Share
Explain
6 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
37 lines
Copy
4 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
35 lines
Copy
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
struct coordinate
struct coordinate
{
{
double x_point;
double x_point;
double y_point;
double y_point;
};
};
struct coordinate linkingpoint;
struct coordinate linkingpoint;
int main()
int main()
{
{
int number;
int number;
scanf("%d", &number);
scanf("%d", &number);
double area;
double area;
double result = 0;
double result = 0;
struct coordinate * all_point = malloc(number*sizeof(struct coordinate));
struct coordinate * all_point = malloc(number*sizeof(struct coordinate));
Copy
Copied
Copy
Copied
//
for (int i = 0; i < number; i++)
for (int i = 0; i < number; i++)
{
{
Copy
Copied
Copy
Copied
scanf("%
f %
f", &all_point[i].x_point, &all_point[i].y_point);
scanf("%
l
f %
l
f", &all_point[i].x_point, &all_point[i].y_point);
}
}
Copy
Copied
Copy
Copied
linkingpoint = all_point[0];
linkingpoint = all_point[0];
for (int i = 1; i < number - 1; i++)
for (int i = 1; i < number - 1; i++)
{
{
area = ((all_point[i].x_point - linkingpoint.x_point) * (all_point[i + 1].y_point - linkingpoint.y_point)) - ((all_point[i].y_point - linkingpoint.y_point)*(all_point[i + 1].x_point - linkingpoint.x_point));
area = ((all_point[i].x_point - linkingpoint.x_point) * (all_point[i + 1].y_point - linkingpoint.y_point)) - ((all_point[i].y_point - linkingpoint.y_point)*(all_point[i + 1].x_point - linkingpoint.x_point));
result += area / 2;
result += area / 2;
}
}
Copy
Copied
Copy
Copied
long double result2;
if (result < 0)
if (result < 0)
result *= -1;
result *= -1;
Copy
Copied
Copy
Copied
result2 = (long double)result;
printf("%.1
l
f", result
);
printf("%.1
L
f", result
2
);
}
}
Saved diffs
Original text
Open file
#include <stdio.h> #include <stdlib.h> struct coordinate { double x_point; double y_point; }; struct coordinate linkingpoint; int main() { int number; scanf("%d", &number); double area; double result = 0; struct coordinate * all_point = malloc(number*sizeof(struct coordinate)); // for (int i = 0; i < number; i++) { scanf("%f %f", &all_point[i].x_point, &all_point[i].y_point); } linkingpoint = all_point[0]; for (int i = 1; i < number - 1; i++) { area = ((all_point[i].x_point - linkingpoint.x_point) * (all_point[i + 1].y_point - linkingpoint.y_point)) - ((all_point[i].y_point - linkingpoint.y_point)*(all_point[i + 1].x_point - linkingpoint.x_point)); result += area / 2; } long double result2; if (result < 0) result *= -1; result2 = (long double)result; printf("%.1Lf", result2); }
Changed text
Open file
#include <stdio.h> #include <stdlib.h> struct coordinate { double x_point; double y_point; }; struct coordinate linkingpoint; int main() { int number; scanf("%d", &number); double area; double result = 0; struct coordinate * all_point = malloc(number*sizeof(struct coordinate)); for (int i = 0; i < number; i++) { scanf("%lf %lf", &all_point[i].x_point, &all_point[i].y_point); } linkingpoint = all_point[0]; for (int i = 1; i < number - 1; i++) { area = ((all_point[i].x_point - linkingpoint.x_point) * (all_point[i + 1].y_point - linkingpoint.y_point)) - ((all_point[i].y_point - linkingpoint.y_point)*(all_point[i + 1].x_point - linkingpoint.x_point)); result += area / 2; } if (result < 0) result *= -1; printf("%.1lf", result); }
Find difference