- 2024-06-06CodeWars Shell Question
CodeWarsShellQuestionClock#https://www.codewars.com/kata/55f9bca8ecaa9eac7100004ah=$1m=$2s=$3echo"(($h*60+$m)*60+$s)*1000"|bcEvenOrOdd#https://www.codewars.com/kata/53da3dbb4a5168369a0000feEvenOrOdd(){if(($1%2==0));then
- 2024-02-06(C语言)代码学习||2024.2.6||题目是codewars上的【 IP Validation】
C语言#sscanf#代码学习#codewars题目链接:IPValidation|Codewars代码如下:#include<stdio.h>intis_valid_ip(constchar*addr){unsignedn[4],i,nc;//Mustbe4integersseparatedbydots:if(sscanf(addr,"%d.%d.%d.%d%n",&n[0],&n
- 2023-10-26003Square(n)Sum(8kyu)from codewars
Square(n)SumCompletethesquaresumfunctionsothatitsquareseachnumberpassedintoitandthensumstheresultstogether.完成平方和函数,对每个传入其中的数字平方并相加。defsquare_sum(numbers):sums=0foriinnumbers:sums+=i*iretu
- 2023-10-26001Sentence Smash(8kyu)from codewars
SentenceSmash(8kyu)Writeafunctionthattakesanarrayofwordsandsmashesthemtogetherintoasentenceandreturnsthesentence.Youcanignoreanyneedtosanitizewordsoraddpunctuation,butyoushouldaddsspacesbetweeneachword.Becareful,ther