C Programming Practice: Random Generation, Menu Systems, and Input Validation

Task 1: Generate Student IDs Based on Random Major Selection The following program generates five student IDs. Each ID starts with either 20256343 (for one major) or 20256136 (for another), followed by a four-digit number. The selection between majors is randomized. #include <stdio.h> #include <stdlib.h> #include <time.h> #de ...

Posted on Sun, 10 May 2026 09:06:22 +0000 by chucklarge

Weekly Contest 357 Solutions

Problem 2810 - Faulty Keeyboard Simulate the keyboard behavior as described. When encuontering character 'i', reverse the current string. class Solution { public: string finalString(string input) { string result = ""; for(char c : input) { if(c == 'i') { reverse(result.begin(), ...

Posted on Sun, 10 May 2026 02:00:36 +0000 by stone

Simulating 3D Hat Color Transformations with Cube Queries

A cube of side length n holds hats arranged in a 3D grid. Each hat has an uppercase letter color, initially G for green. Implementation uses an integer representation where 'A' maps to 1 and 'G' maps to 7 via the formula int(letter)-64. Supported operations within axis-aligned rectangular regions: Paint all hats within a specified sub‑cube wit ...

Posted on Sat, 09 May 2026 11:39:01 +0000 by HyperD

Laser Scanning Simulation Using a Simple Physics Engine in MATLAB

This article provides a simulation environment for modeling laser beams hitting object surfaces and the ground. Users can configure the laser range, resolution, object position, size, and rotation. Recently, we needed to analyze occlusions caused by objects in a laser scanner's background. Unable to find a suitable environment, we built one in ...

Posted on Thu, 07 May 2026 20:47:33 +0000 by Benmcfc

Position-Based Dynamics and Implicit Integration for Cloth Simulation

Position-Based Dynamics (PBD) In a cloth simulation, each particle is influenced by gravity when external forces like collisions or spring constraints are ignored. The velocity and position are updated accordingly: float dt = 0.0333f; float damping = 0.99f; Vector3[] positions; // X Vector3[] velocities; // V Vector3 g = new Vector3(0.0f, -9.8f ...

Posted on Thu, 07 May 2026 10:49:05 +0000 by shadowk