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> | |
int main() | |
{ | |
const int max = 10; | |
int numere[max], len = 0, n; | |
while (len < max && scanf("%d", &n) == 1) | |
{ | |
numere[len++] = n; | |
if (len >= 10 || getchar() == '\n') | |
break; |
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 <time.h> | |
int main() | |
{ | |
time_t t = time(NULL); | |
struct tm tm = *localtime(&t); | |
int an_curent = tm.tm_year + 1900; | |
const int varsta_maxima = 125; | |
int anul_nasterii, varsta; | |
puts("In ce an te-ai nascut?"); |
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> | |
int main() | |
{ | |
const int an_curent = 2022, varsta_maxima = 125; | |
int anul_nasterii, varsta; | |
puts("In ce an te-ai nascut?"); | |
if (scanf("%d", &anul_nasterii) < 1) | |
{ | |
puts("Eroare."); | |
return 1; |
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> | |
/* A - 1 data, B - de 2 ori, C - de 3 ori s.a.m.d. */ | |
/* A-C: litere mari, d-h: litere mici */ | |
void afiseaza_litera_cu_casing_potrivit_de_un_numar_de_ori_potrivit(char c) | |
{ | |
char de_afisat = c; | |
if (c >= 'D') | |
{ | |
de_afisat = c + ('a' - 'A'); | |
} |
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> | |
/* A - 1 data, B - de 2 ori, C - de 3 ori s.a.m.d. */ | |
void afiseaza_litera_de_un_numar_de_ori_potrivit(char c) | |
{ | |
for (char i = 'A'; i <= c; i++) | |
{ | |
printf("%c", c); | |
} | |
printf("\n"); | |
} |
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> | |
int main() | |
{ | |
const int an_curent = 2022; | |
int anul_nasterii, varsta; | |
puts("In ce an te-ai nascut?"); | |
scanf("%d", &anul_nasterii); | |
varsta = an_curent - anul_nasterii; | |
printf("Varsta ta este: %d\n", varsta); | |
return 0; |
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 <SDL.h> | |
int main() | |
{ | |
SDL_Init(SDL_INIT_VIDEO); | |
const int w = 800, h = 600; | |
SDL_Window *window = SDL_CreateWindow("Drawing-sample", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, 0); | |
SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0); | |
SDL_Event event; |
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
<html> | |
<body style="text-align: center;"> | |
<div id="container" style="background-color: red; width: 40%; display: inline-block;"></div> | |
<div id="reference" style="background-color: green; width: 40%; display: inline-block;"></div> | |
<script> | |
let itemCount = 1000, itemHeight = 21; | |
for (var i = 0; i < itemCount; i++) { | |
let item = document.createElement('div'); | |
item.style.height = itemHeight + 'px'; | |
item.style.backgroundColor = i % 2 == 0 ? '#f0f0f0' : '#e0e0e0'; |
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
class MyViewController { | |
// ... | |
override var prefersStatusBarHidden: Bool { | |
if super.prefersStatusBarHidden { return true } | |
if #available(iOS 14.0, *) { | |
return ProcessInfo.processInfo.isiOSAppOnMac | |
} | |
return false | |
} | |
} |
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
import RealityKit | |
import UIKit | |
import PlaygroundSupport | |
let arView = ARView(frame: CGRect() , cameraMode: .ar, automaticallyConfigureSession: true) | |
PlaygroundPage.current.setLiveView(arView) | |
let planeAnchor = AnchorEntity(plane: .horizontal) | |
arView.scene.addAnchor(planeAnchor) | |
let ballMesh = MeshResource.generateSphere(radius: 0.1) | |
let ballMaterial = SimpleMaterial(color: .purple, isMetallic: false) |
NewerOlder