Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
1
1-tracer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SO2
1-tracer
Commits
455c54ba
Commit
455c54ba
authored
2 years ago
by
Baruta Daniel Mihail
Browse files
Options
Downloads
Patches
Plain Diff
Add readme
parent
bea36442
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+9
-0
9 additions, 0 deletions
README.md
src/main.c
+0
-11
0 additions, 11 deletions
src/main.c
src/solution.c
+18
-0
18 additions, 0 deletions
src/solution.c
with
27 additions
and
11 deletions
README.md
0 → 100644
+
9
−
0
View file @
455c54ba
# Perfect assignment
Write a program that given a number as input argument prints the corespondig number of 1s on standard output.
E.g:
```
bash
$>
./binary 3
1 1 1
```
This diff is collapsed.
Click to expand it.
src/main.c
+
0
−
11
View file @
455c54ba
...
...
@@ -3,16 +3,5 @@
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
2
)
{
fprintf
(
stderr
,
"Not enough arguments!
\n
"
);
return
1
;
}
int
number
=
atoi
(
argv
[
1
]);
for
(
int
i
=
0
;
i
<
number
;
i
++
)
printf
(
"1 "
);
printf
(
"
\n
"
);
return
0
;
}
This diff is collapsed.
Click to expand it.
src/solution.c
0 → 100644
+
18
−
0
View file @
455c54ba
#include
<stdio.h>
#include
<stdlib.h>
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
2
)
{
fprintf
(
stderr
,
"Not enough arguments!
\n
"
);
return
1
;
}
int
number
=
atoi
(
argv
[
1
]);
for
(
int
i
=
0
;
i
<
number
;
i
++
)
printf
(
"1 "
);
printf
(
"
\n
"
);
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment