pastebin
Add a new paste
View all pastes
Change language
Dutch
English
French
Russian
menu
URL Shortener
Multiple URL shortener
browser info
Whois IP and domain lookup
Capture a Website screenshot
Disqus Chatroom
Registration
pastebin
Paste Search Dynamic
Recent pastes
Binance
4 hours ago
Jsonutility argumentexception
5 hours ago
base OnStartAuthority
5 hours ago
NetworkClient AddPlayer
5 hours ago
WebGL Failed to load resource
5 hours ago
Unity err memory
5 hours ago
Unity Package Cache error
5 hours ago
JNI Error
5 hours ago
GLFW Error
5 hours ago
Process crashed
5 hours ago
p1 p2
#include <iostream>
using
namespace
std;
int
main
(
)
{
float
x1,x2,y1,y2,x,y,p;
cout<<
"enter p1(x1,y1) and p2(x2,y2) n"
;
cin>>x1;
cin>>y1;
cin>>x2;
cin>>y2;
x=x1;
y=y1;
p=p
+2
*
(
y2-y1
)
-
(
x2-x1
)
;
while
(
x<x2
)
{
if
(
p>
0
)
{
p=p
+2
*
(
y2-y1
)
-2
*
(
x2-x1
)
;
x++;
y++;
}
else
{
p=p
+2
*
(
y2-y1
)
;
x++;
y=y;
}
cout<<x;
cout<<
","
;
cout<<y;
cout<<
"n"
;
}
return
0
;
}
Parsed in 0.007 seconds