瀏覽代碼

add new file l6.c

Stepan 2 月之前
父節點
當前提交
d334435628
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      c/l6.c

+ 12 - 0
c/l6.c

@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+int main() {
+    int pol;
+    printf("Enter number ");
+    scanf("%d", &pol);
+    int x1 = pol % 10;
+    int x2 = (pol / 10) % 10;
+    int x3 = ((pol / 10) / 10) % 10;
+    int sum = x1+x2+x3;
+    printf("%d\n", sum);
+}