Validate on submit. Input JSON: {"email": string, "password": string}. Rules: email must contain @ and . → else email invalid; password length ≥ 8 → else password too short. Print each error on its own line (email first), or submitted when valid.
Input: one JSON object.
Output: errors or submitted.
Your program reads from stdin and prints to stdout.
Example 1
Input: {"email":"a@b.com","password":"longenough"}
Output: submitted
Hints
Validate on submit. Input JSON: {"email": string, "password": string}. Rules: email must contain @ and . → else email invalid; password length ≥ 8 → else password too short. Print each error on its own line (email first), or submitted when valid.
Input: one JSON object.
Output: errors or submitted.
Your program reads from stdin and prints to stdout.
Example 1
Input: {"email":"a@b.com","password":"longenough"}
Output: submitted
Hints