#if defined(linux) || defined(_WIN32)
#include <GL/glut.h> /*??? Linux ? Windows*/
#else
#include <GLUT/GLUT.h> /*??? Mac OS*/
#endif
#include <iostream>
#include <math.h>
using namespace std;
int n,a=2,al=0,c=200;
int X[100];
int Y[100];
int R[100];
void processNormalKeys(unsigned char key, int x, int y) {
int i=0;
if (key == 109) ::a-=10;
if (key == 112) ::a+=10;
if (key == 114) ::al+=1;
if (key == 108) ::al-=1;
if ((key == 109)||(key == 112)||(key == 114)||(key == 108)){
for(i=0,i<(::n),i++){
::X[i]=::c+::a*::R[i]*cos(::al);
::Y[i]=::c+::a*::R[i]*sin(::al);
}
}
}
void reshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, w, 0, h);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void display()
{
int i = 0;
glClear(GL_COLOR_BUFFER_BIT);
glClear(GL_DEPTH_BUFFER_BIT);
glClear(GL_ACCUM_BUFFER_BIT);
glClear(GL_STENCIL_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(1.0, 1.0, 1.0);
for(i=0,i<::n,i++){
glVertex2i(::X[i],::Y[i]);
}
glEnd();
glutSwapBuffers();
}
int main (int argc, char * argv[])
{
int i=0;
FILE *f;
f=fopen("in.txt","r");
fscanf(f,"%i",&::n);
for(i=0,i<::n,i++){
fscanf(f,"%i",::X+i);
};
for(i=0,i<::n,i++){
fscanf(f,"%i",::Y+i);
};
fclose(f);
for(i=0,i<::n,i++){
::R[i]=floor(sqrt((::X[i]-::c)*(::X[i]-::c)+(::Y[i]-::c)* (::Y[i]-::c)));
};
for(i=0,i<::n,i++){
::X[i]=::c+::a*::R[i]*cos(::al);
::Y[i]=::c+::a*::R[i]*sin(::al);
};
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA);
glutInitWindowSize(800, 600);
glutCreateWindow("OpenGL 1");
glutReshapeFunc(reshape);
glutKeyboardFunc(processNormalKeys);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
C:\Users\zxcvbnm\Documents\jjj\main.cpp In function 'void processNormalKeys(unsigned char, int, int)': 24 22 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ';' before ')' token 28 2 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before '}' token 28 2 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ';' before '}' token 28 2 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before '}' token 28 2 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ')' before '}' token 28 2 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before '}' token C:\Users\zxcvbnm\Documents\jjj\main.cpp In function 'void display()': 56 20 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before ':' token 56 20 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ']' before ':' token 59 15 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] could not convert 'glEnd()' from 'void' to 'bool' 60 26 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ')' before ';' token C:\Users\zxcvbnm\Documents\jjj\main.cpp In function 'int main(int, char**)': 70 14 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before ':' token 70 14 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ']' before ':' token 73 3 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before 'for' 73 3 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ')' before 'for' 73 14 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before ':' token 73 14 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ']' before ':' token 76 12 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ')' before ';' token 77 14 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before ':' token 77 14 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ']' before ':' token 80 3 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before 'for' 80 3 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ')' before 'for' 80 14 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected primary-expression before ':' token 80 14 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ']' before ':' token 88 30 C:\Users\zxcvbnm\Documents\jjj\main.cpp [Error] expected ')' before ';' token 28 C:\Users\zxcvbnm\Documents\jjj\Makefile.win recipe for target 'main.o' failed
Как минимум, всякие
for(i=0,i<::n,i++)
должны быть
for(i=0;i<::n;i++)
(обратите внимание на точки с запятой).
Айфон мало держит заряд, разбираемся с проблемой вместе с AppLab
Перевод документов на английский язык: Важность и ключевые аспекты
Есть команда состоящая из нескольких частей: действие -> объекты над которыми действие совершается
На Form есть DataGridView (в нём показывается одна строка) и WebBrowser