- This topic has 0 replies, 1 voice, and was last updated 3 years, 4 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
aiannum.com has rebranded as Progaiz.com
› Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 1: [C] – Data Types, Operators, Conditional Statements, Loops, and Command Line › Mario: Forming first row
As part of solving Mario problem, I have broken it into first coming out with the first row with # on the last column. Even this appears tricky to me! Any tips or hints appreciated as to how to modify with the following initial code:
[dm_code_snippet background=”yes” background-mobile=”yes” slim=”no” line-numbers=”yes” bg-color=”#abb8c3″ theme=”dark” language=”clike” wrapped=”no” height=”” copy-text=”Copy Code” copy-confirmed=”Copied”]
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int t = get_int("height\n");
for (int i = 0; i <t; i++)
{
printf("#");
}
}
[/dm_code_snippet]
Perhaps need to build with t – 1 taking dots or blank spaces and t taking #.
Reply
https://edstem.org/us/courses/176/discussion/1678193[learn_press_profile]
