Skip to content

Instantly share code, notes, and snippets.

@KeitetsuWorks
Created November 20, 2018 14:02
Show Gist options
  • Select an option

  • Save KeitetsuWorks/aecb659e8ea23d24e601a023ade52fd6 to your computer and use it in GitHub Desktop.

Select an option

Save KeitetsuWorks/aecb659e8ea23d24e601a023ade52fd6 to your computer and use it in GitHub Desktop.
/**
* @file q11199328296.cpp
* @brief q11199328296
* @author Keitetsu
* @date 2018/11/20
* @copyright Copyright (c) 2018 Keitetsu
* @par License
* This software is released under the MIT License.
*/
#include <cstdio>
int main(void)
{
int line_num;
int i, j;
fprintf(stdout, "行を入力: ");
scanf("%d", &line_num);
i = 0;
while (i < line_num) {
j = 0;
while (j < line_num) {
if (j < (line_num - 1 - i)) {
fprintf(stdout, " ");
}
else {
fprintf(stdout, "*");
}
j++;
}
fprintf(stdout, "\n");
i++;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment