Question d’entretien chez Mallow Technologies

Given a 14 digit date time value as input (D), whose format is YYYYMMDDHHMISS. YYYY – represents year (Examples: 1947, 2000, 2015) MM – represents month (Examples: 12, 01, 03) DD – represents day (Examples: 31, 01, 15) HH – represents hour (Examples: 00, 01, 12, 23) MI – represents minute (Examples: 59, 50, 00, 05) SS – represents second (Examples: 59, 50, 00 06) You will also be given another integer, called the offset value (O), in seconds. You are required to print a 14 digit output date in the format YYYYMMDDHHMISS which is adjusted for the offset from the input date. Constraints: 10010101000000 < D < 39991231235959 -94638758399 < O < 94638758399 Sample Input: 19470815000008 17 Sample Output: 19470815000025 Explanation: The input 19470815000008 represents August 15, 1947 00:00:08. If you adjust the input date with 17 seconds, you will get the date August 15, 1947 00:0025. Hence the output is 19470815000025.

Réponse à la question d'entretien

Utilisateur anonyme

18 déc. 2019

long long a; scanf("%lld",&a); int b; scanf("%d",&b); printf("%lld",a+b);

17