+ 1
My first C program... Do I know how should I do to make mare efficient or make the same in another way?.. Plz
2 Antworten
+ 2
It's ok. Some minor things could be changed, but that's just for style:
1. line comments shouldn't be indented
2. close curly braces on a new line
3. use indention to make blocks clear visible
4. since you just used the I for the loop you can declare it inside the head of the for loop
5. you can assign a[0] to t directly in the declaration
Keep in mind that styles are a preference. There are various ways to make you code more readable. It's up to you how you do it, but you should keep a style the same for a single code. Same indentions, same curly brace placement, etc. If you mix it up it gets confusing.
https://code.sololearn.com/cDu1tKG9priJ/?ref=app
0
Thanx Alex