Category: ACM

17
Jul
2016

Draw Brasenham Line Drawing Algorithms with Random Lines and Colors

Code: #include <windows.h> #include <GL\glut.h> #include <stdlib.h> #include<iostream> using namespace std; int x, y, a, b, nol,…

30
Jun
2016

How to count numbers from string ?

code: #include<stdio.h> #include<stdlib.h> int main(){ char line[]=”1 -2 10000 -50 20 7 445 -4″; char *p,*e; long…

23
Jun
2016

Swap in C

Swap in C #include<stdio.h> int main() { int x,y,z; x=5; y=7; printf(“Before x=%d y=%d\n”,x,y); z=x; x=y; y=z;…

12
May
2016

Triangular Number Java Code True or False

Here yo can see what is triangular number: https://en.wikipedia.org/wiki/Triangular_number public class NumShape { public static void main(String[]…

11
May
2016

Problem 5 from 52 programming problems book

#include<iostream> #include<cstdio> using namespace std; int main() { int testcase,star,i,j,k; cin>>testcase; for(i=0; i<testcase; i++) { cin>>star; for(j=0;…

11
May
2016

Problem 4 from 52 programming problems book

Solution: #include<iostream> #include<cstdio> using namespace std; int main() { int testcase,i,num_range,j; cin>>testcase; for(i=1; i<=testcase; i++) { cin>>num_range;…