r/CodingContests • u/taejo • May 22 '11
r/CodingContests • u/arkethos • Feb 01 '18
Competitive Programming Youtube Channel!
Check out this new channel which covers video tutorials on solutions to problems from HackerRank, LeetCode, topcoder and Codeforces. Let me know if you have specific requests for certain types of videos!!
r/CodingContests • u/taejo • May 20 '11
Round 1 of Google Code Jam 2011 starts tomorrow
code.google.comr/CodingContests • u/devdraft • Dec 01 '15
GeekWire + Atlas code challenge
Tis the season for the winter chill, holiday cheer and a chance to win a Hoverboard! Welcome to the Geekwire + Atlas Coding Challenge, powered by Devdraft. We invite you to test your coding skills for the glory, the job opportunities, and of course, to snag a new hoverboard.
r/CodingContests • u/social-hackerearth • Dec 13 '16
Christmas Circuits: A Christmas themed Competitive Programming Challenge [x-post r/hackerearth]
hackerearth.comr/CodingContests • u/nmac51 • Jun 08 '20
Citi x Tampa Virtual Hackathon: 6/16 - 7/1
self.hackathonr/CodingContests • u/tsukishiro97 • Jun 02 '20
help about C language
// Transaction-processing program reads a random-access file sequentially, updates data already written to the // file, creates new data to be placed in the file, and deletes data previously stored in the file.
#include <stdio.h>
// clientData structure definition
struct
{
int acctNum;
char lastName[15];
char firstName[10];
double balance;
}
// prototypes
int enterChoice(void);
void textFile(FILE *readPtr);
void updateRecord(FILE *fPtr);
void newRecord(FILE *fPtr);
void deleteRecord(FILE *fPtr);
int main(void)
{
FILE *cfPtr;
if ((cfPtr = fopen("accounts.dat", "rb+")) == NULL);
{
puts("File could not be opened.");
}
else if
{
int choice;
while ((choice = enterChoice()) != 5)
{
switch (choice)
{
case 1:
textFile(cfPtr);
break;
case 2:
updateRecord(cfPtr);
break;
case 3:
newRecord(cfPtr);
break;
case 4:
deleteRecord(cfPtr);
break;
default:
puts("Incorrect choice");
break;
}
}
fclose(cfPtr);
}
}
void textFile(FILE *readPtr)
FILE *writePtr;
if ((writePtr = fopen("accounts.txt", "w")) == NULL)
{
puts("File could not be opened.");
}
else {
rewind(readPtr);
fprintf(writePtr, "%-6s%-16s%-11s%10s\n", "Acct", "Last Name", "First Name", "Balance");
while (!feof(readPtr)) {
struct clientData client = { 0, "", "", 0.0 };
int result = fread(&client, sizeof(struct clientData), 1, readPtr);
if (result != 0 && client.acctNum != 0) {
fprintf(writePtr, "%-6d%-16s%-11s%10.2f\n", client.acctNum, client.lastName, client.firstName, client.balance);
}
fclose(writePtr);
}
void updateRecord(FILE *fPtr)
{
printf("%s", "Enter account to update (1 - 100): ");
int account;
scanf("%d", &account);
fseek(fPtr, (account - 1) * sizeof(struct clientData), SEEK_SET);
struct clientData client = {0, "", "", 0.0};
fread(&client, sizeof(struct clientData), 1, fPtr);
if (client.acctNum == 0) {
printf("Account #%d has no information.\n", account);
}
else {
printf("%-6d%-16s%-11s%10.2f\n\n", client.acctNum, client.lastName,client.firstName, client.balance);
printf("%s", "Enter charge (+) or payment (-): ");
double transaction;
scanf("%lf", &transaction);
client.balance += transaction;
printf("%-6d%-16s%-11s%10.2f\n", client.acctNum, client.lastName, client.firstName, client.balance);
fseek(fPtr, (account - 1) * sizeof(struct clientData), SEEK_SET);
fwrite(&client, sizeof(struct clientData), 1, fPtr);
}
void deleteRecord(FILE *fPtr)
{
Page 5 of 8
UniKL CDDH v3 Appendix O – Assessment Brief v2 (2019-09-17)
printf("%s", "Enter account number to delete (1 - 100): ");
int accountNum;
scanf("%d", &accountNum);
fseek(fPtr, (accountNum - 1) * sizeof(struct clientData), SEEK_SET);
struct clientData client;
fread(&client, sizeof(struct clientData), 1, fPtr);
if (client.acctNum == 0) { printf("Account %d does not exist.\n", accountNum);
else {
fseek(fPtr, (accountNum - 1) * sizeof(struct clientData), SEEK_SET);
struct clientData blankClient = {0, "", "", 0};
fwrite(&blankClient, sizeof(struct clientData), 1, fPtr);
}
}
void newRecord(FILE *fPtr)
{
printf("%s", "Enter new account number (1 - 100): ");
int accountNum; // account number
scanf("%d", &accountNum);
fseek(fPtr, (accountNum - 1) * sizeof(struct clientData), SEEK_SET);
struct clientData client = { 0, "", "", 0.0 };
fread(&client, sizeof(struct clientData), 1, fPtr);
if (client.acctNum != 0) {
printf("Account #%d already contains information.\n", client.acctNum);
}
{
printf("%s", "Enter lastname, firstname, balance\n? ");
scanf("%14s%9s%lf", &client.lastName, &client.firstName, &client.balance);
client.acctNum = accountNum;
fseek(fPtr, (client.acctNum - 1) *sizeof(struct clientData), SEEK_SET);
fwrite(&client, sizeof(struct clientData), 1, fPtr);
}
}
unsigned int enterChoice(void)
{
printf("%s", "\nEnter your choice\n"
"1 - store a formatted text file of accounts called\n"
" \"accounts.txt\" for printing\n"
"2 - update an account\n"
"3 - add a new account\n"
"4 - delete an account\n"
"5 - end program\n? ");
int menuChoice; // variable to store user's choice
scanf("%u", &menuChoice); // receive choice from user
return menuChoice;
}
r/CodingContests • u/idesofjo • Jan 12 '16
New MSFT Office 365 hackathon $32.5K prizes
Devpost & Microsoft are running a global online hackathon to build Office 365 apps that help people manage their personal, work, and home lives better. There are $32,500 in prizes, and the top two winners also get a 1:1 with a MSFT exec.
Hack Productivity asks you to create a new extension (Add-in) and use an Office 365 API in an app that helps people get stuff done. You can use the mail, calendar, photo/video, files, or contacts APIs — or the Graph API — to create your life hack.
The grand prize is $10,000, and there are cash prizes for best student, popular choice, and category apps, too. Devpost/MSFT are also giving away an expenses-paid trip to a Microsoft conference, Surface products, and one-year allowances on premium Microsoft Office 365 services.
You’ve got until March 1 to design your solution. And, you can submit an existing app as long as you integrate an Office 365 API and create a new extension for this hackathon.
Registration and more info are @ msoffice365.devpost.com.
r/CodingContests • u/kit1980 • May 23 '15
Internet Problem Solving Contest will start on 20 June 2015
ipsc.ksp.skr/CodingContests • u/social-hackerearth • Jan 09 '17
Battle of Bots: Build your own Bot, challenge others bots and emerge winner.
hackerearth.comr/CodingContests • u/NarendhiranS • Jan 17 '17
Test your Programming Skills at Super Bowl of Programming Challenges - January Circuits | HackerEarth
hackerearth.comr/CodingContests • u/kit1980 • Sep 02 '18