Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
………………„-^*'' : : „'' : : : : *-„
…………..„-* : : :„„--/ : : : : : : : '\
…………./ : : „-* . .| : : : : : : : : '|
……….../ : „-* . . . | : : : : : : : : |
………...\„-* . . . . .| : : : : : : : :'|
……….../ . . . . . . '| : : : : : : : :|
……..../ . O . . O . .'\ : : : : : : |
……../ . . . . . . . . . .\ : : : : : : :|
……./ . . . __. .. . . . . '\ : : : : : /
….../ . . . .. . . . . . . . . *-„„„„-*'
….'/ . . . . . . . . . . . . . . '|
…/ . . . . . . . ./ . . . . . . .|
../ . . . . . . . .'/ . . . . . . .'| Cole este homem de chapéu no perfil de seus amigos para dar
./ . . . . . . . . / . . . . . . .'| boa sorte!
'/ . . . . . . . . . . . . . . . .'|
'| . . . . . \ . . . . . . . . . .|
'| . . . . . . \„_^- „ . . . . .'|
'| . . . . . . . . .'\ .\ ./ '/ . |
| .\ . . . . . . . . . \ .'' / .
typedef struct {
int x, y;
} Ponto;
typedef struct {
Ponto supEsq;
Ponto infDir;
} Retangulo;
Ponto createPonto(int x1, int y1){
Ponto p = {x1, y1};
return p;
}
Retangulo createRetangulo(int x1, int y1, int x2, int y2) {
Retangulo r = {{x1,y1}, {x2,y2}};
return r;
};
int dentro(Retangulo r, Ponto p);
int main(){
int x1, y1, x2, y2;
scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
Retangulo r = createRetangulo(x1, y1, x2, y2);
int x, y;
scanf("%d %d", &x, &y);
Ponto p = createPonto(x,y);
printf("%d\n", dentro(r,p) ); //1
}
int dentro(Retangulo r, Ponto p){
Ponto supEsq = r.supEsq;
Ponto infDir = r.infDir;
if( p.x >= supEsq.x && p.x <= infDir.x && p.y >= infDir.y && p.y <= supEsq.y )
return 1;
}
}
⣿⣿⣿⣿⡿⠋⠁⠄⠄⠄⠄⠄⠄⠄⠄⠚⠿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⡟⠄⣀⣤⣤⣀⣀⠄⠄⣀⣀⣤⣄⡀⠘⣿⣿⣿⣿⣿
⣿⣿⠿⠃⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆⠘⠿⣿⣿⣿
⣿⠁⣴⡄⢸⣿⣿⠁⠈⣿⣿⣿⡟⠄⠈⣿⣿⡇⢸⣦⠘⣿⣿
⣿⡄⠻⠇⠄⠻⣿⣦⣴⣿⢻⡟⣿⣤⣴⣿⠟⠄⠹⠟⢠⠋⠄
⣿⣿⣶⡀⠄⠄⣼⣿⣿⣿⣾⣷⣿⣿⣿⣆⠄⠄⢰⣾⡇⠄⢸
⣿⣿⣿⣷⡀⠄⢻⣧⣄⡀⠄⠄⣀⣠⣿⡏⠄⠄⠘⠿⣷⣄⠄
⣿⣿⣿⣿⣿⣦⣄⡙⠻⠿⢿⡿⠿⠟⠋⠄⠄⠄⠄⠄⠈⢻⣿
⣿⣿⣿⣿⣿⣿⣿⣿⠁⠄⠄⢀⠾⠿⢿⣶⡄⠄⠄⠄⠄⠄⢻
⣿⣿⣿⣿⣿⣿⣿⠇⠄⠄⢀⠂⠄⠄⠄⠙⢿⡆⠄⠄⠄⠄⠄
⣿⣿⣿⣿⣿⣿⡟⠄⠄⢀⣾⠄⠄⠄⠄⠄⠄⢻⠄⠄⠄⠄⠄
⣿⣿⣿⣿⣿⣿⠃⠄⢀⣾⣇⠄⠄⠄⠄⠄⠄⠈⠄⠄⠄⠄⠄
⣿⣿⣿⣿⣿⣿⣶⣠⣾⣿⣿⣤⣤⣸⡀⠄⠄⠄⠄⠄⠄⠄⠄