This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
using std::string; | |
class TV { // Construtor da classe TV | |
private: // Declaração dos atributos privados da classe | |
string model; // Modelo | |
bool state; // Estado do aparelho (ligado ou desligado) | |
unsigned int channel; // Canais | |
unsigned int snd_volume; // Volume do som |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
struct personagem{ | |
char nome[32]; | |
char funcao[32]; | |
int forca; | |
int saude; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
void soma (int *m[4][4]) | |
{ | |
int i, j; | |
int soma_principal=0; | |
int soma_secundaria=0; | |
for(i=0; i<4; i++){ | |
for(j=0; j<4; j++){ | |
if(j==i){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct aluno{ | |
char nome[30]; | |
int ra; | |
}; | |
int main() | |
{ | |
struct aluno a1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
struct aluno{ | |
char nome[50]; | |
int ra; | |
}; | |
int main() | |
{ | |
struct aluno a1[3]; | |
int i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <string.h> | |
struct resultado{ | |
char resul[20]; | |
int mesmo[3] | |
}; | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define tamanho 5 | |
int main() | |
{ | |
float altura[tamanho]; | |
int i,j,cont[tamanho]; | |
float media,soma=0,moda,mediana; | |
for(i=0;i<tamanho;i++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define n 10 | |
#include <time.h> | |
int main() | |
{ | |
int vet1[n],vet2[n],uniao[n*2]; | |
int i,j,vdd=0,max,cont=0;; | |
srand(time(NULL)); | |
printf("Primeiro vetor:\n"); |