Validar Endereço IPv4
CodeChefOpen on judge ↗
Sabendo que um endereço IPv4 tem o formato xxx.xxx.xxx.xxx, onde xxx é um número de 0 a 255, desenvolva uma função que receba, da consola, um endereço IPv4, sob o formato de String, e retorne 1 caso este seja válido, e 0 em caso contrário. ###Input: -IPv4, sob a forma de String ###Output: -0 ou 1 ###Sample Input 1: "192.168.0.1" ###Sample Output 1: 1 ###Sample Input 2: "192.168.xyz.1" #
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start