update
All checks were successful
Markup Tests / test (push) Successful in 8s
Markdown to Html Tests / test (push) Successful in 17s

This commit is contained in:
2026-02-17 09:32:08 +03:00
commit 2f05f238e9
109 changed files with 9369 additions and 0 deletions

28
java/sum/Sum.java Normal file
View File

@@ -0,0 +1,28 @@
package sum;
/**
* @author Nikita Doschennikov (me@fymio.us)
*/
public class Sum {
public static void main(String[] args) {
int res = 0;
for (String arg : args) {
StringBuilder builder = new StringBuilder();
for (char c : arg.toCharArray()) {
if (!Character.isWhitespace(c)) {
builder.append(c);
} else {
res += (!builder.toString().isEmpty())
? Integer.parseInt(builder.toString())
: 0;
builder = new StringBuilder();
}
}
res += (!builder.toString().isEmpty())
? Integer.parseInt(builder.toString())
: 0;
}
System.out.println(res);
}
}